Issue Details (XML | Word | Printable)

Key: JRUBY-1347
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Charles Oliver Nutter
Reporter: Jerome Dochez
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
JRuby

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

Created: 13/Sep/07 04:10 PM   Updated: 06/Jan/08 05:42 PM   Resolved: 30/Sep/07 09:44 AM
Return to search
Component/s: None
Affects Version/s: JRuby 1.0.1
Fix Version/s: JRuby 1.0.2, JRuby 1.1b1

Time Tracking:
Not Specified

Environment: windows
Issue Links:
Related
 

Patch Submitted: Yes


 Description  « Hide

_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...



Charles Oliver Nutter added a comment - 13/Sep/07 04:12 PM

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


Charles Oliver Nutter added a comment - 13/Sep/07 04:37 PM

Fixed in 4315 on trunk and 4316 on 1.0 branch.


Charles Oliver Nutter made changes - 13/Sep/07 04:37 PM
Field Original Value New Value
Fix Version/s JRuby 1.1.0 [ 13534 ]
Status Open [ 1 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]
Assignee Thomas E Enebo [ enebo ] Charles Oliver Nutter [ headius ]
Fix Version/s JRuby 1.0.2 [ 13682 ]
Bill Dortch added a comment - 17/Sep/07 03:16 AM

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


Bill Dortch made changes - 17/Sep/07 03:16 AM
Status Resolved [ 5 ] Reopened [ 4 ]
Resolution Fixed [ 1 ]
Bill Dortch made changes - 17/Sep/07 03:56 AM
Link This issue relates to JRUBY-1367 [ JRUBY-1367 ]
Bill Dortch added a comment - 17/Sep/07 03:56 AM

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


Matthew Foemmel added a comment - 25/Sep/07 12:04 PM

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


Matthew Foemmel added a comment - 25/Sep/07 12:09 PM

Sorry, that should be:

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


Matthew Foemmel added a comment - 25/Sep/07 12:11 PM

JIRA keeps eating my backslashes - trying again:

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


Matthew Foemmel added a comment - 25/Sep/07 12:15 PM

Fourth time's the charm:

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

Charles Oliver Nutter added a comment - 30/Sep/07 09:44 AM

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


Charles Oliver Nutter made changes - 30/Sep/07 09:44 AM
Resolution Fixed [ 1 ]
Status Reopened [ 4 ] Resolved [ 5 ]
Charles Oliver Nutter made changes - 22/Dec/07 06:28 AM
Status Resolved [ 5 ] Closed [ 6 ]
Kaj Hejer added a comment - 06/Jan/08 02:56 PM

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


Charles Oliver Nutter added a comment - 06/Jan/08 05:42 PM

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.