JRuby

wrong algorithm in _jrubyvars.bat to set the classpath for jruby

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: JRuby 1.0.1
  • Fix Version/s: JRuby 1.0.2, JRuby 1.1b1
  • Component/s: None
  • Labels:
    None
  • Environment:
    windows
  • Patch Submitted:
    Yes
  • Number of attachments :
    0

Description

_jrubyvars.bat batch is broken on windows, it does not only add the jars in jruby/lib directory but all jars located in sub directories.

this is inconsistent with unix platforms and create issues with glassfish v3 integration.

if you replace

for /r "%JRUBY_HOME%\lib" %%i in (*.jar) do @call "%~dp0_jrubysetcp" %%i
with
for %%i in ("%JRUBY_HOME%\lib"*.jar) do @call "%~dp0_jrubysetcp" %%i

in _jrubyvars.bat

it works as expected...

Issue Links

Activity

Hide
Charles Oliver Nutter added a comment -

Excellent find Jerome, thank you! I will commit this to trunk and 1.0.

Show
Charles Oliver Nutter added a comment - Excellent find Jerome, thank you! I will commit this to trunk and 1.0.
Hide
Charles Oliver Nutter added a comment -

Fixed in 4315 on trunk and 4316 on 1.0 branch.

Show
Charles Oliver Nutter added a comment - Fixed in 4315 on trunk and 4316 on 1.0 branch.
Hide
Bill Dortch added a comment -

Hmm, I think this needs to be reexamined. With the patch applied, I can no longer load jirb (haven't tried with other apps):

Exception in thread "main" java.lang.NoClassDefFoundError: org/jruby/Main

If I revert the change, it works fine. Same problem/fix for both 1.x and 1_0.

WinXp, Java 1.6

Show
Bill Dortch added a comment - Hmm, I think this needs to be reexamined. With the patch applied, I can no longer load jirb (haven't tried with other apps):
Exception in thread "main" java.lang.NoClassDefFoundError: org/jruby/Main
If I revert the change, it works fine. Same problem/fix for both 1.x and 1_0. WinXp, Java 1.6
Hide
Bill Dortch added a comment -

Reverted in 4335 (1_0), 4336 (trunk), pending better solution. See also JRUBY-1367.

Show
Bill Dortch added a comment - Reverted in 4335 (1_0), 4336 (trunk), pending better solution. See also JRUBY-1367.
Hide
Matthew Foemmel added a comment -

I think there's a small typo in the proposed fix above that prevents it from working. If I replace the second double-quote with a backslash, and put the double-quote after "*.jar", it works on my machine:

for %%i in ("%JRUBY_HOME%\lib*.jar") do @call "%~dp0_jrubysetcp" %%i

Show
Matthew Foemmel added a comment - I think there's a small typo in the proposed fix above that prevents it from working. If I replace the second double-quote with a backslash, and put the double-quote after "*.jar", it works on my machine: for %%i in ("%JRUBY_HOME%\lib*.jar") do @call "%~dp0_jrubysetcp" %%i
Hide
Matthew Foemmel added a comment -

Sorry, that should be:

for %%i in ("%JRUBY_HOME%\lib*.jar") do @call "%~dp0_jrubysetcp" %%i

Show
Matthew Foemmel added a comment - Sorry, that should be: for %%i in ("%JRUBY_HOME%\lib*.jar") do @call "%~dp0_jrubysetcp" %%i
Hide
Matthew Foemmel added a comment -

JIRA keeps eating my backslashes - trying again:

for %%i in ("%JRUBY_HOME%\lib
*.jar") do @call "%~dp0_jrubysetcp" %%i

Show
Matthew Foemmel added a comment - JIRA keeps eating my backslashes - trying again: for %%i in ("%JRUBY_HOME%\lib
*.jar") do @call "%~dp0_jrubysetcp" %%i
Hide
Matthew Foemmel added a comment -

Fourth time's the charm:

for %%i in ("%JRUBY_HOME%\lib\*.jar") do @call "%~dp0_jrubysetcp" %%i
Show
Matthew Foemmel added a comment - Fourth time's the charm:
for %%i in ("%JRUBY_HOME%\lib\*.jar") do @call "%~dp0_jrubysetcp" %%i
Hide
Charles Oliver Nutter added a comment -

Yep, it was just a typo in the original fix. I've committed the updated fix on both branches.

Show
Charles Oliver Nutter added a comment - Yep, it was just a typo in the original fix. I've committed the updated fix on both branches.
Hide
Kaj Hejer added a comment -

In trunk (rev 5511) I now get

$ jruby -version
Exception in thread "main" java.lang.NoClassDefFoundError: org/jruby/Main

I'm on osx 10.5.1 and java 1.5.0_13-b05-237

Show
Kaj Hejer added a comment - In trunk (rev 5511) I now get $ jruby -version Exception in thread "main" java.lang.NoClassDefFoundError: org/jruby/Main I'm on osx 10.5.1 and java 1.5.0_13-b05-237
Hide
Charles Oliver Nutter added a comment -

Kaj: that seems like you just need a rebuild or jruby.jar is missing. Either way it is unrelated to this bug. If you can still reproduce it after a clean build and your ENV looks ok please file a bug or contact us on freenode IRC in #jruby.

Show
Charles Oliver Nutter added a comment - Kaj: that seems like you just need a rebuild or jruby.jar is missing. Either way it is unrelated to this bug. If you can still reproduce it after a clean build and your ENV looks ok please file a bug or contact us on freenode IRC in #jruby.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: