Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 256674 - Jython doesn't work when JAVA_HOME isn't set or is set incorrectly
Jython doesn't work when JAVA_HOME isn't set or is set incorrectly
Status: NEW
Product: python
Classification: Unclassified
Component: Build
PC All
: P3 (vote)
Assigned To: Lou Dasaro
Depends on:
  Show dependency treegraph
Reported: 2015-11-18 21:03 UTC by vincentvdl
Modified: 2015-11-18 22:23 UTC (History)
0 users

See Also:
Issue Type: DEFECT


Note You need to log in before you can comment on or make changes to this bug.
Description vincentvdl 2015-11-18 21:03:01 UTC

When trying to run the Swing Jython example as described in the Synergy test, I get the following traceback:

Traceback (most recent call last):
  File "<string>", line 444, in <module>
  File "<string>", line 435, in main
  File "Z:\jythondev\jython27\src\shell\build\jython\out00-PYZ.pyz\subprocess", line 522, in call
  File "Z:\jythondev\jython27\src\shell\build\jython\out00-PYZ.pyz\subprocess", line 710, in __init__
  File "Z:\jythondev\jython27\src\shell\build\jython\out00-PYZ.pyz\subprocess", line 958, in _execute_child
WindowsError: [Error 2] The system cannot find the file specified

About info NB IDE 8.1:

Product Version: NetBeans IDE 8.1 (Build 201510222201)
Java: 1.8.0_45; Java HotSpot(TM) 64-Bit Server VM 25.45-b02
Runtime: Java(TM) SE Runtime Environment 1.8.0_45-b15
System: Windows 8 version 6.2 running on amd64; Cp1252; en_US (nb)
User directory: C:\Users\Vincent\AppData\Roaming\NetBeans\8.1
Cache directory: C:\Users\Vincent\AppData\Local\NetBeans\Cache\8.1
Comment 1 vincentvdl 2015-11-18 21:14:05 UTC
I think this StackOverflow question is related to this problem:
Comment 2 vincentvdl 2015-11-18 21:25:17 UTC
Somehow my JAVA_HOME in my Environment Variables settings was not correct. 

In Windows 10: 
Start > Settings > Search in the search-bar on "System" > choose "System" in the list > Advanced system settings > Environment Variables... > In System variables list (second one), find and double-click the "JAVA_HOME" variable and ensure that directory exists.

If the JAVA_HOME entry does not exist, then add it.

If I understand Jim Baker's post in the mentioned StackOverlow discussion correctly, Jython does not work when the path has quotes, so double-check that the JAVA_HOME path does not have quotes (they are not necessary here, even not when using spaces in directory names)

After correcting my JAVA_HOME path and restarting NB, the problem went away.
Comment 3 Lou Dasaro 2015-11-18 22:23:35 UTC
This becomes a documentation task for me. Users are required to set environment variable JAVA_HOME to reference a valid location for the installed Java.
I believe this needs to be a JDK, and not just a JRE - further investigation required...

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo