Issue1076

classification
Title: 2.5a1 jython.bat doesn't work from Windows explorer
Type: behaviour Severity: normal
Components: Installer Versions: 2.5alpha1
Milestone:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: dergo, nriley
Priority: Keywords:

Created on 2008-07-17.07:55:15 by dergo, last changed 2008-07-19.20:49:11 by nriley.

Files
File name Uploaded Description Edit Remove
unnamed dergo, 2008-07-18.07:06:14
Messages
msg3342 (view) Author: David Ergo (dergo) Date: 2008-07-17.07:56:24
Jython.bat doesn't work when launched from Windows explorer:
Exception in thread "main" java.lang.NoClassDefFoundError: 
Files\jython2/5a1+\jython/bat
Caused by: java.lang.ClassNotFoundException: 
Files\jython2.5a1+\jython.bat
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClassInternal(Unknown Source)

Solution:
Change "-Dpython.executable="%~0" into "Jython.bat doesn't work when 
launched from Windows explorer:

Exception in thread "main" java.lang.NoClassDefFoundError: 
Files\jython2/5a1+\jython/bat
Caused by: java.lang.ClassNotFoundException: 
Files\jython2.5a1+\jython.bat
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClassInternal(Unknown Source)

Solution:
Change '-Dpython.executable="%0"' into '-Dpython.executable="%~0"'
in generated Jython.bat
msg3349 (view) Author: Nicholas Riley (nriley) Date: 2008-07-17.20:45:13
Works for me.  What version of Windows are you using?
msg3353 (view) Author: David Ergo (dergo) Date: 2008-07-18.07:06:14
Windows XP Pro.

I installed Jython in 'C:\Program Files\Jython2.5a1+', i.e. the directory
path contains spaces !
I suppose Windows Explorer set quotes around filename in %0 if directory
path contain spaces,
so if you use "%0", the quotes are doubled and you need to first remove the
eventual quotes of %0,
i.e. do "%~0".
David

2008/7/17 Nicholas Riley <report@bugs.jython.org>:

>
> Nicholas Riley <njriley+bugs.jython.org@uiuc.edu> added the comment:
>
> Works for me.  What version of Windows are you using?
>
> ----------
> nosy: +nriley
>
> _______________________________________
> Jython tracker <report@bugs.jython.org>
> <http://bugs.jython.org/issue1076>
> _______________________________________
>
msg3354 (view) Author: Nicholas Riley (nriley) Date: 2008-07-19.20:49:11
Thanks; I was using c:\temp to test which explains why I wasn't seeing the 
problem.

I fixed the installer in r4972 to use our new launcher scripts, which handle 
spaces in pathnames.  2.5a2 should do a better job for you when it's 
released.
History
Date User Action Args
2008-07-19 20:49:11nrileysetstatus: open -> closed
resolution: fixed
messages: + msg3354
2008-07-18 07:06:15dergosetfiles: + unnamed
messages: + msg3353
2008-07-17 20:45:13nrileysetnosy: + nriley
messages: + msg3349
2008-07-17 07:56:24dergosetmessages: + msg3342
2008-07-17 07:55:15dergocreate