I am working with a library that uses ProcessBuilder to fork another JVM
process however the forked process is unable to find any of the jars I
required in my ruby program e.g. “Error: Could not find or load main
class
X”
After looking over
(https://github.com/jruby/jruby/wiki/ClasspathAndLoadPath)
I am still unsure about what the best approach to adding jars & paths to
the java.class.path System property.
My workaround for this is to set the property manually, e.g.
full_classpath = [java.lang.System.properties[‘java.class.path’],
File.join(File.expand_path(’…/…/vendor/jars-test’, FILE), ‘*’)]
java.lang.System.properties[‘java.class.path’] =
full_classpath.join(’:’)
Is there a better way to do this?
Ariel V.
e-mail: [email protected]
website: http://blog.arielvalentin.com
skype: ariel.s.valentin
twitter: arielvalentin
linkedin: http://www.linkedin.com/profile/view?id=8996534