Thomas E Enebo created JRUBY-6620:
-------------------------------------

             Summary: On windows if JAVA_HOME ends in a '\' then native 
launcher bombs
                 Key: JRUBY-6620
                 URL: https://jira.codehaus.org/browse/JRUBY-6620
             Project: JRuby
          Issue Type: Bug
          Components: Launcher
    Affects Versions: JRuby 1.6.7
            Reporter: Thomas E Enebo
            Priority: Critical
             Fix For: JRuby 1.7


This is the reproduction:

{noformat}
C:\Users\enebo>set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_23\

C:\Users\enebo>jruby -Xtrace trace.log -v
Exception in thread "main" java.lang.NoClassDefFoundError: bar
Caused by: java.lang.ClassNotFoundException: bar
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: bar.  Program will exit.
{noformat}

And here is the trace.log:

{noformat}
Starting platform... 
        Binary name is: jruby

Module: c:\jruby-1.6.7.1\bin\jruby.dll
Platform dir: c:\jruby-1.6.7.1
Parsing arguments:
        -Xtrace
        trace.log
        -v
-Xjdkhome is not set, checking for %JAVA_HOME%...
%JAVA_HOME% is set: C:\Program Files\Java\jdk1.6.0_23\
JvmLauncher::initialize()
        javaPathOrMinVersion: C:\Program Files\Java\jdk1.6.0_23\
checkJava(C:\Program Files\Java\jdk1.6.0_23\)
File "C:\Program Files\Java\jdk1.6.0_23\jre\bin\client\jvm.dll" does not exist
File "C:\Program Files\Java\jdk1.6.0_23\jre\bin\server\jvm.dll" exists
File "C:\Program Files\Java\jdk1.6.0_23\jre\bin\java.exe" exists
File "C:\Program Files\Java\jdk1.6.0_23\jre\bin\javaw.exe" exists
*** No need to clean the binary name: jruby
constructBootClassPath()
File "c:\jruby-1.6.7.1\lib\jruby.jar" exists
addToBootClassPath()
        path: c:\jruby-1.6.7.1\lib\jruby.jar
        onlyIfExists: true
File "c:\jruby-1.6.7.1\lib\jruby.jar" exists
File "c:\jruby-1.6.7.1\lib\jruby-complete.jar" does not exist
BootclassPath: c:\jruby-1.6.7.1\lib\jruby.jar
constructClassPath()
addJarsToClassPathFrom()
        dir: c:\jruby-1.6.7.1
addToClassPath()
        path: c:\jruby-1.6.7.1\lib\jruby.jar
        onlyIfExists: false
No need to add "c:\jruby-1.6.7.1\lib\jruby.jar" to classpath, it's already in 
bootclasspath
No explicit classpath option is used, looking up %CLASSPATH% env
addToClassPath()
        path: C:\foo bar bag\
        onlyIfExists: false
ClassPath: C:\foo bar bag\;
JvmLauncher::getJavaPath()
Starting application...
JvmLauncher::start()
        mainClassName: org/jruby/Main
        separateProcess: false
  args:
        -v
  options:
        -Djdk.home=C:\Program Files\Java\jdk1.6.0_23\
        -Djruby.home=c:\jruby-1.6.7.1
        -Djruby.script=jruby
        -Djruby.shell=cmd.exe
        
-Djffi.boot.library.path=c:\jruby-1.6.7.1\lib\native\i386-Windows;c:\jruby-1.6.7.1\lib\native\x86_64-Windows
        -Xmx500m
        -Xss2048k
        -Djruby.memory.max=500m
        -Djruby.stack.max=2048k
        -Dsun.java.command=org.jruby.Main
        -Djava.class.path=C:\foo bar bag\;
        -Xbootclasspath/a:c:\jruby-1.6.7.1\lib\jruby.jar
Java DLL path: C:\Program Files\Java\jdk1.6.0_23\jre\bin\server\jvm.dll
PrepareDllPath: C:\Program Files\Java\jdk1.6.0_23\jre\bin
Falling back to running Java in a separate process; DLL cannot be loaded 
(64-bit DLL?).
Command line:
"C:\Program Files\Java\jdk1.6.0_23\jre\bin\java.exe" "-Djdk.home=C:\Program 
Files\Java\jdk1.6.0_23\" "-Djruby.home=c:\jruby-1.6.7.1" "-Djruby.script=jruby" 
"-Djruby.shell=cmd.exe" 
"-Djffi.boot.library.path=c:\jruby-1.6.7.1\lib\native\i386-Windows;c:\jruby-1.6.7.1\lib\native\x86_64-Windows"
 "-Xmx500m" "-Xss2048k" "-Djruby.memory.max=500m" "-Djruby.stack.max=2048k" 
"-Dsun.java.command=org.jruby.Main" "-Djava.class.path=C:\foo bar bag\;" 
"-Xbootclasspath/a:c:\jruby-1.6.7.1\lib\jruby.jar" org/jruby/Main "-v"
onExit()
{noformat}

Notice that -Djdk.home now ends in a '\"'.  It looks like CMD will literalize 
this into a "?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to