Author jamesmudd
Recipients jamesmudd
Date 2017-03-13.22:39:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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.

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"

Traceback (most recent call last):
  File "", line 444, in <module>
    if __name__ == "__main__":
  File "", line 435, in main
    print command
  File "", line 168, in call
  File "", line 390, in __init__
  File "", 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?
Date User Action Args
2017-03-13 22:39:33jamesmuddsetrecipients: + jamesmudd
2017-03-13 22:39:33jamesmuddsetmessageid: <>
2017-03-13 22:39:33jamesmuddlinkissue2569 messages
2017-03-13 22:39:32jamesmuddcreate