Answer the question
In order to leave comments, you need to log in
Error when working with COM Port Java JSSC?
Good day! I'm trying to add the JSSC library to the project to read data from the com port, but I see an error:
Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: java.lang.NoClassDefFoundError: jssc/SerialPortList
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:133)
Caused by: java.lang.NoClassDefFoundError: jssc/SerialPortList
at com.traction.game.SerialController.<init>(SerialController.java:7)
at com.traction.game.Menu.create(Menu.java:13)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:149)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:126)
Caused by: java.lang.ClassNotFoundException: jssc.SerialPortList
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)
... 4 more
import jssc.SerialPortList;
public class SerialController {
public SerialController() {
String[] portNames = SerialPortList.getPortNames();
System.out.println("Ports");
for(int i = 0; i < portNames.length; i++){
System.out.println(portNames[i]);
}
}
}
import com.badlogic.gdx.Game;
import com.badlogic.gdx.Screen;
public class Menu extends Game{
@Override
public void create() {
setScreen((Screen) new Traction());
SerialController portController;
portController = new SerialController();
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question