include Java
cp = ENV["CLASSPATH"]
cp.split(/[;]/).each{|el| puts "#{el}"}
I changed a path in my CLASSPATH environment variable via regedit in Windows 7 but when I run the script above it prints me the old paths. Why doesn't it recognize that CLASSPATH has changed?
edit: It works after a computer reboot, but can't it work without having to do that?
                        
just
set CLASSPATH=before running the script (will be kept until you close that particular command line) http://docs.oracle.com/javase/7/docs/technotes/tools/windows/classpath.htmlalternatively explicitly specify
-cpon the command line withjruby:jruby -J-classpath C:\java\MyClasses;C:\java\foo.jar ...(overridesCLASSPATH)