Invoke another program multiple times
in
Integration and Hardware
•
2 months ago
Hello Everyone,
I have wrote a processing program (A) in eclipse, and now I want to use another program to invoke A multiple times (sequentially) each with different arguments.
I looked up how to do it in Java, but it gives me NoClassDefFoundError for core/PApplet. I cannot figure out how to fix this. Does anyone know how to solve this?
Thanks for your help in advance!
Betty
Here is the code.
- Runtime runTime = Runtime.getRuntime();
- //external is the folder where I have my core.jar
- //LowGame contains my main and it's in the control package, 2 is the command argument I want to pass in
- Process process = runTime.exec("java -classpath C:\\Users\\chang\\git\\Game\\external\\core.jar -classpath C:\\Users\\chang\\git\\Game\bin control.LowGame 2");
Here is the error message I'm getting:
Standard Error: java.lang.NoClassDefFoundError: processing/core/PApplet
at java.lang.ClassLoader.defineClass1(Native Method)
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$100(Unknown Source)
at java.net.URLClassLoader$1.run(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)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
Caused by: java.lang.ClassNotFoundException: processing.core.PApplet
at java.net.URLClassLoader$1.run(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)
... 13 more
Exception in thread "main"
1