https://github.com/jbangdev/jbang-eclipse
JBang / Eclipse integration
https://github.com/jbangdev/jbang-eclipse
Last synced: 18 days ago
JSON representation
JBang / Eclipse integration
- Host: GitHub
- URL: https://github.com/jbangdev/jbang-eclipse
- Owner: jbangdev
- License: epl-2.0
- Created: 2021-04-12T12:22:16.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2025-11-10T19:09:03.000Z (4 months ago)
- Last Synced: 2025-11-10T21:09:02.943Z (4 months ago)
- Language: Java
- Homepage:
- Size: 2.05 MB
- Stars: 4
- Watchers: 1
- Forks: 4
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://marketplace.eclipse.org/content/jbang-eclipse-integration)
JBang / Eclipse integration POC
===============================
This experimental plugin aims to let you author [JBang](https://github.com/jbangdev/jbang) scripts in Eclipse with ease.
## Features:
- 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 Script as project
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.
## Synchronize JBang
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.
## Recommended 3rd party plugins
* Automatic source downloads: Currently, JBang dependencies sources are not automatically fetched. You can install the [PDE source lookup](https://marketplace.eclipse.org/content/pde-source-lookup) plugin to automatically download sources from Maven Central, when opening a type from a JBang dependency.
Installation
------------
_JBang Eclipse Integration_ is available in the [Eclipse Marketplace](https://marketplace.eclipse.org/content/jbang-eclipse-integration). Drag the following button to your running Eclipse workspace. (⚠️ *Requires the Eclipse Marketplace Client*)
[](http://marketplace.eclipse.org/marketplace-client-intro?mpc_install=5391163 "Drag to your running Eclipse* workspace. *Requires Eclipse Marketplace Client")
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
Build
-----
**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--SNAPSHOT.zip`
License
-------
EPL 2.0, See [LICENSE](LICENSE) file.