History | Log In     View a printable version of the current page.  
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
Component/s: None
Affects Version/s: JRuby 1.0.1
Fix Version/s: JRuby 1.1b1, JRuby 1.0.2

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



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Charles Oliver Nutter - 13/Sep/07 04:12 PM
Excellent find Jerome, thank you! I will commit this to trunk and 1.0.

Charles Oliver Nutter - 13/Sep/07 04:37 PM
Fixed in 4315 on trunk and 4316 on 1.0 branch.

Bill Dortch - 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 - 17/Sep/07 03:56 AM
Reverted in 4335 (1_0), 4336 (trunk), pending better solution. See also JRUBY-1367.

Matthew Foemmel - 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 - 25/Sep/07 12:09 PM
Sorry, that should be:

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


Matthew Foemmel - 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 - 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 - 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.

Kaj Hejer - 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 - 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.