Show HN: Jeval allows to run Java scripts as ordinary executable files

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

7 points | by lambdaprime 913 days ago

1 comments

  • selfhoster11 913 days ago
    Why should this be chosen over Beanshell, or the new Java interpreter?
    • lambdaprime 912 days ago
      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.