没有任何数据可供显示
开源项目社区 | 当前位置 : |
|
www.trustie.net/open_source_projects | 主页 > 开源项目社区 > javashellscript |
javashellscript
|
0 | 0 | 89 |
贡献者 | 讨论 | 代码提交 |
JavaShellScript is a tool to run small Java programs as shell scripts.How jss worksWith jss (short for JavaShellScript) you can run java programs, without compiling them, directly as if they were shell scripts. jss will compile the Java-file and save the class file in a cache. When you call the Program the next time, jss will run the cached class file, if the source file isn't changed.
You can use jss with every Java program. The only thing you need to do is to add a Shebang line to your source code. The file don't need to have the .java suffix.
A "Hello World" sampleFirst create a file sample.java with the following content
#!/usr/bin/env jss
public class sample {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}Make the file executable:
chmod +x sample.javaRun the program:
./sample.java