This experimental plugin aims to let you author JBang scripts in Eclipse with ease.
- Import JBang Scripts as projects
- Synchronize JBang Dependencies to existing projects
- Automatically configures JDKs managed by JBang
- Validation of JBang scripts on file save
- Automatic configuration of Annotation Processors
- JBang runtime management
Currently supports
//DEPS
/@Grab
dependencies//JAVA
version//SOURCES
additional sources
By default, the plugin will try to find JBang from the PATH, from ~/.jbang/bin
or ~/.sdkman/candidates/jbang/current/bin/jbang
. Alternate locations can be defined in Preferences
> JBang
> Installations
Import JBang scripts in Eclipse: Import Project... > JBang > JBang script.
A project named after the script file will be created in the current workspace, that will link to the real script file.
The Synchronize JBang
command is available when right-clicking on a JBang script in an existing project. If the script belongs to a non-Java project, the Java nature will be added to that project.
The source folder containing the JBang file will automatically be added to the project's classpath. The JBang Dependencies
classpath container will be added to the classpath as well.
Caveats:
- JBang files and dependencies will leak to the project's main and test-scoped sources
- the project's main files and dependencies will leak to the JBang script
- If the script file is at the root of the project and there are other source folders nested beneath that root, compilation errors will occur in those folders
- Other build tools (m2e/buildship) might conflict with the classpath changes. Typically, Updating the Maven project configuration would remove the JBang source folder and its classpath container. Re-running
Synchronize JBang
will be necessary to get completion and validation in JBang scripts.
- Automatic source downloads: Currently, JBang dependencies sources are not automatically fetched. You can install the PDE source lookup plugin to automatically download sources from Maven Central, when opening a type from a JBang dependency.
JBang Eclipse Integration is available in the Eclipse Marketplace. Drag the following button to your running Eclipse workspace. (
Alternatively, in Eclipse:
- open Help > Install New Software...
- work with:
https://github.com/jbangdev/jbang-eclipse/releases/download/latest/
- expand the category and select the Jbang Eclipse Feature
- proceed with the installation
- restart Eclipse
Requires Java 17 or more recent to build/run
Open a terminal and execute:
./mvnw clean package
You can then install the generated update site from dev.jbang.eclipse.site/target/repository
, also zipped as dev.jbang.eclipse.site-<VERSION>-SNAPSHOT.zip
EPL 2.0, See LICENSE file.