Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: Jeval allows to run Java scripts as ordinary executable files
7 points by lambdaprime 41 days ago | hide | past | favorite | 2 comments
With new version of jeval we added support for shebag (#!) directive which is available in Unix-like operating systems.

It allows to run scripts written in Java without calling jeval. Instead of:

jeval script.java

You can run it directly as ordinary executable file:

./script.java

For that to work you need to put following line as a first line of script.java:

#!/usr/bin/env jeval

And make file executable:

chmod u+x script.java

https://github.com/lambdaprime/jeval




Why should this be chosen over Beanshell, or the new Java interpreter?


With jeval we try not to modify/extend Java syntax for lambdas, variable type inference, method pointers or anything else. It means that your code is backwards compatible with Java.

jeval is based on jshell and tries to provide better integration with cli. Please see Overview http://portal2.atwebpages.com/jeval/ for examples. It also allows you to declare dependencies in Java scripts to any libraries from Maven repository so that jeval will automatically resolve them and add to the script class path.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: