java exec problem with class path
Hello, I'm trying to execute java program from another java application:
Process process = Runtime.getRuntime().exec(commandLine);
When the commands looks like:
java -cp my_class_path org.jetel.main.runGraph parameters
everything works properly, but when the my_class_path is quoted:
java -cp "my_class_path" org.jetel.main.runGraph parameters
I get error:
Exception in thread "main" java.lang.NoClassDefFoundError: org/jetel/main/runGraph
More over the last command:
java -cp "my_class_path" org.jetel.main.runGraph parameters
is executed properly when running from command line.
I have SUSE OS and java 1.6, but the application, that calls the exec method runs with java 1.5
Did anyone fence the above problem? What could help?
|