Programming Tutorials

Comment on Tutorial - Sample Java program shows how to write to COM port using Java. By Johanes



Comment Added by : Tebogo Modiselle

Comment Added at : 2014-10-31 08:47:09

Comment on Tutorial : Sample Java program shows how to write to COM port using Java. By Johanes
Hi
I can compile it
root$ javac -cp .:comm-2.0.jar SimpleCOMPortWriter.java but it fails on execution.

Please advise.



Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2531)
at java.lang.Class.getMethod0(Class.java:2774)
at java.lang.Class.getMethod(Class.java:1663)
at sun.launcher.LauncherHelper.getMainMethod(LauncherHelper.java:494)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:486)
Caused by: java.lang.ClassNotFoundException: javax.comm.PortInUseException
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 6 more


View Tutorial