Jython in NetBeans
NetBeans can host Jython development through its Python support (the free PyDev-based "Python" module) or the older Jython integration, giving you Jython project templates, interpreter configuration, and debugging inside the IDE - a natural fit since NetBeans is Java-native and Jython projects are Java-plus-Python.
Enable Python Support
- Tools -> Plugins -> Available Plugins.
- Find and install the Python (PyDev) plugin - or the Jython plugin on older NetBeans releases.
- Restart NetBeans.
Create a Jython Project
- File -> New Project -> Python -> Python Application (or Jython, where offered).
- Name and location; choose the Python 2.7 flavor to match Jython.
- In the project properties, set the interpreter to your Jython installation.
Configure the Jython Interpreter
- Tools -> Options -> Python -> Python Interpreters.
- Add an interpreter pointing at the jython executable (jython.sh / jython.bat).
- NetBeans indexes the interpreter's site-packages plus your project's libraries for completion.
Adding Java Libraries
- Project Properties -> Libraries (or the project's classpath configuration).
- Add the jars your script imports (java.* from the JDK plus any third-party jars).
- The editor resolves those imports for completion and error marking.
Running and Debugging
- Right-click the main .py -> Run File (or set a main class in Run Configuration) to execute with Jython.
- Set breakpoints in the editor and use Debug -> Debug Project for step-through debugging with a variables and call stack view.
- Console output (print statements, Java logging) appears in the IDE's output tab.
Why NetBeans for Jython
- Java and Python projects side by side in one IDE - edit the Java jars' sources if you have them, then the Jython code that calls them.
- Integrated refactoring for the Python side via PyDev, Java tooling for the rest.
- Profiler and profiler-like tooling for JVM apps if you later move to pure Java.
Summary
Set up Jython in NetBeans by installing the Python/PyDev plugin, creating a Python 2.7 project, registering the Jython interpreter under Tools -> Options, and adding your jars to the project libraries. You then get completion for java.* imports, run configurations for jython, and breakpoints with a full debugger - a solid Java-plus-Python development environment.