Message11223

Author jamesmudd
Recipients jamesmudd
Date 2017-03-13.22:39:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1489444773.85.0.808384306318.issue2569@psf.upfronthosting.co.za>
In-reply-to
Content
Trying to execute the jython using the exe or python launch script on Windows fails if JAVA_HOME environment variable is set

Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.

C:\Users\user\Desktop\dist\bin>jython.exe
Jython 2.7.1rc1 (, Mar 13 2017, 08:51:49)
[Java HotSpot(TM) 64-Bit Server VM (Oracle Corporation)] on java1.8.0_121
Type "help", "copyright", "credits" or "license" for more information.
>>> 
KeyboardInterrupt -------- Works Ok

C:\Users\user\Desktop\dist\bin>set JAVA_HOME="C:\Program Files\Java\jdk1.8.0_121"

C:\Users\user\Desktop\dist\bin>jython.exe
Traceback (most recent call last):
  File "jython.py", line 444, in <module>
    if __name__ == "__main__":
  File "jython.py", line 435, in main
    print command
  File "subprocess.py", line 168, in call
  File "subprocess.py", line 390, in __init__
  File "subprocess.py", line 640, in _execute_child
WindowsError: [Error 5] Access is denied
Failed to execute script jython --------- Fails

Running as admin doesn't help. I think the problem is when JAVA_HOME is set then cmd used to invoke java is the full path C:\Program Files\Java\jdk1.8.0_121\bin\java and python doesn't seem to have permission to launch this. However when JAVA_HOME is not set the cmd used is just java and it relies on java being on the path, it seems python can launch this?

Any ideas for a fix? Or others give it a try and see if it fails for you?
History
Date User Action Args
2017-03-13 22:39:33jamesmuddsetrecipients: + jamesmudd
2017-03-13 22:39:33jamesmuddsetmessageid: <1489444773.85.0.808384306318.issue2569@psf.upfronthosting.co.za>
2017-03-13 22:39:33jamesmuddlinkissue2569 messages
2017-03-13 22:39:32jamesmuddcreate