crude Runtime.exec to call java -cp not working in linux

Posted by pstanton on Stack Overflow See other posts from Stack Overflow or by pstanton
Published on 2010-05-11T12:28:00Z Indexed on 2010/05/11 12:34 UTC
Read the original article Hit count: 352

Filed under:
|
|

I'm using a java process to spawn many other java processes using Runtime.exec(cmd) where cmd is like the following:

java -cp "MyJar.jar" pkg.MyClass some-more-arguments

running the same command from the command line works fine in windows and linux, however when my spawning java process calls the command via Runtime.exec it works in windows but not in linux.

in linux i get Exception in thread "main" java.lang.NoClassDefFoundError: pkg/MyClass

any ideas?

© Stack Overflow or respective owner

Related posts about java

Related posts about runtime.exec