You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
not sure how the java runtime 'knows' the pwd. one way is to set the user.dir system property:
``jruby -e 'Dir.chdir("..");java.lang.System.set_property("user.dir", File.expand_path("."));p java.io.File.new("").absolute_path;p java.lang.System.get_property("user.dir")'`
which does the trick at least for java.io.File
usually I am using jruby and ruby almost exchangable, i.e. ruby calls java and java calls ruby . . .
when looking at the jruby sources I am not sure whether the place to 'add' the system property fix is RubyDir.java or Ruby.java
The text was updated successfully, but these errors were encountered:
It sucks, but we should make our best effort to emulate chdir and deal with it at external integration points (anywhere that needs to see the chdir) rather than forcibly chdir the whole JVM (which will never work in typical server settings).
jruby -e 'Dir.chdir("..");p File.expand_path(".");p java.io.File.new("").absolute_path;p java.lang.System.get_property("user.dir")'
produces
"/home/christian/projects/active/maven/tesla-polyglot/tesla-polyglot-gems"
"/home/christian/projects/active/maven/tesla-polyglot/tesla-polyglot-gems/ruby-maven"
"/home/christian/projects/active/maven/tesla-polyglot/tesla-polyglot-gems/ruby-maven"
not sure how the java runtime 'knows' the pwd. one way is to set the user.dir system property:
``jruby -e 'Dir.chdir("..");java.lang.System.set_property("user.dir", File.expand_path("."));p java.io.File.new("").absolute_path;p java.lang.System.get_property("user.dir")'`
which does the trick at least for java.io.File
usually I am using jruby and ruby almost exchangable, i.e. ruby calls java and java calls ruby . . .
when looking at the jruby sources I am not sure whether the place to 'add' the system property fix is RubyDir.java or Ruby.java
The text was updated successfully, but these errors were encountered: