I’ve imported all the RXTX jar files and linked them to eclipse which works fine. However when I then export the class to a runnable jar file it fails on the following line and won’t even return a exception message:
If it works in Eclipse testing the .class file, but does not work from a jar file, you probably have a standard class/library not found issue.
( not directly related to RxTx or Processing or Arduino )
What makes it perhaps harder than usual here, is the required native library, which has to be found and must be for the desired environment ( 32 / 64 bit )
won’t even return a exception message:
Native libraries can crash the JVM ! That produces an error message (and file) on a different level
Before testing the your jar file:
Do you get the class file to execute outside Eclipse ? This shows if you have control over the required environment.
.class to .jar adds another level of possible problems.
A bit more information about your environment, what happens, and what you expect, might help us give you more hints 8)
getPortIdentifiers() does not need many lines of code to be in a suitable environment, can you post them here ?
All the libraries are within the project and native libraries are linked. It will compile in command prompt but returns the following error:
Exception in thread "main" java.lang.NoClassDefFoundError: SerialCommunications
(wrong name: GreenhousePackage/SerialCommunications)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: SerialCommunications. Program will exit.
Exception in thread "main" java.lang.NoClassDefFoundError: SerialCommunications
(wrong name: GreenhousePackage/SerialCommunications)
...
Could not find the main class: SerialCommunications.
So where's the problem understanding this message?
Something wrong with the class path or package name, CapiTaliZation ?