Linux command
jbang 命令
网络
复制后可按需替换文件名、目录或参数。
常用示例
Run Java script
jbang [script.java]
Create new script
jbang init [script.java]
Run with dependencies
jbang [script.java]
Edit in IDE
jbang edit [script.java]
Install as command
jbang app install [script.java]
Run from URL
jbang [https://example.com/script.java]
说明
jbang runs Java programs as scripts without build tools. It handles dependencies, compilation, and execution automatically. The tool supports inline dependency declarations using comments. It enables shell-script style Java programming.
参数
- init _FILE_
- Create new script.
- run _FILE_
- Run script (default).
- edit _FILE_
- Open in IDE.
- app install _FILE_
- Install script as app.
- --deps _GAV_
- Add Maven dependencies.
- --java _VERSION_
- Use specific Java version.
- --help
- Display help information.
FAQ
What is the jbang command used for?
jbang runs Java programs as scripts without build tools. It handles dependencies, compilation, and execution automatically. The tool supports inline dependency declarations using comments. It enables shell-script style Java programming.
How do I run a basic jbang example?
Run `jbang [script.java]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does init _FILE_ do in jbang?
Create new script.