I'm running GUI that has a start and stop button.
The startbutton starts a process with a long function.
The stopbutton forecully stops this process.
I think the error message is telling me that when I start the process it says it's missing libraries?
While if I run it from my project itsself it runs just fine.
in GUI.java
private void startButton(string PathToClass) {
try {
// Command to start the Side-process
ProcessBuilder pb = new ProcessBuilder(JAVA_COMMAND, "-cp", PathToClass, "com.example.SideProcess");
pb.inheritIO();
SideProcess = pb.start();
} catch (IOException e) {
e.printStackTrace();
}
}
in SideProcess.java
public static void main(String[] args){
System.out.println("is running...");
SideProcess sidetask = new SideProcess ();
sidetask.run();
}
The error message:
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/jna/platform/win32/User32
at com.example.WindowHandleUtils.findWindowContainingTitle(WindowHandleUtils.java:21)
at com.example.WindowHandleUtils.<init>(WindowHandleUtils.java:15)
at com.example.Game.<init>(Game.java:17)
at com.example.ColorDetectionUtils.<init>(ColorDetectionUtils.java:10)
at com.example.SideProcess.<init>(SideProcess.java:10)
at com.example.SideProcess.main(SideProcess.java:24)
Caused by: java.lang.ClassNotFoundException: com.sun.jna.platform.win32.User32
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
... 6 more