-
-
Notifications
You must be signed in to change notification settings - Fork 922
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jruby.bash includes current directory in classpath, should not #2783
Comments
We had been adding . to classpath because by default the
Given this, do you still feel like we should change it? |
Okay, I was looking at it from the Ruby side, which doesn't include the current directory by default.
If you are favoring Java compatibility over Ruby compatibility, then anyone affected by the problem can use the "nonexistent directory" work around to get the current directory out of |
@headius hmm, in the new load-service I put a quite some effort in to not find resources in current directory unless the "." is in $LOAD_PATH. there are a couple of test which check this but they do switch the ruby current directory to somewhere else and then the old load-service does not find it. well I expected things to be the ruby way - like @derek-upham |
maybe we should make my "omitted" testcase to test what we want to have. |
Can somebody give a look on https://github.com/compiler-tech/dsl_in_action_ch4_ruby_trade . Why |
@jiamo classpath != load-path the first sets "." to the classpath and the second sets it to the load-path - two different things. MRI does not to inside "." unless "." is on the load-path. the same jruby does whether it can find files on the classpath or not. jruby will honor the MRI behavior. |
@mkristian thanks. In my situation I alreay compile rb files to class files, and add . to classpath, seem it does't concern the load-path? |
it should be no difference whether the ruby files are compiled or not. your examples should work like this:
maybe even
did not check out your code so far. |
Hi, In my situation, |
since there is no trade_dsl JRuby can not find it
|
Thanks, Using |
The
jruby.bash
script in jruby-1.7 and jruby-9.0.0.0 sticks the$CLASSPATH
environment variable onto the end of the calculated-classpath
argument$CP
. The concatentation process happens whether or not$CLASSPATH
exists:This means if you don't specify a
$CLASSPATH
,-classpath
ends up with a trailing colon:That trailing colon puts the process root directory into
-classpath
, whether or not you wanted it there. It's possible to work around this by setting$CLASSPATH
to a non-existent file/directory:but it seems more appropriate to not put the current directory into
-classpath
unless you explicitly request it:I have included a sample patch against jruby-1.7.11 which fixes the problem. It may also apply cleanly to the latest jruby-9.0.0.0 code.
The text was updated successfully, but these errors were encountered: