This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 256674

Summary: Jython doesn't work when JAVA_HOME isn't set or is set incorrectly
Product: python Reporter: vincentvdl
Component: BuildAssignee: Lou Dasaro <mr_lou_d>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 8.1   
Hardware: PC   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description vincentvdl 2015-11-18 21:03:01 UTC
Link: http://services.netbeans.org/synergy/client/app/

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:

http://stackoverflow.com/questions/30410385/jython-exe-2-7-0-final-release-failed-execution-on-my-windows-os
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...