-
Enhancement
-
Resolution: Not an Issue
-
P3
-
None
-
8
-
unix-like - linux, ubuntu, Mac OS X, cygwin, ...
-
generic
-
generic
One of the great features of Nashorn is the ability to use jjs to do shell scripting and create shebang executables. JavaScript is a great language for developing tools, ex.; build scripts, repo management, and potentially rework of tools like mercurial and gradle.
This is potential huge for promoting broad use of the JVM via Nashorn.
The problem is that jjs floats around in $JAVA_HOME/bin/ or $JAVA_HOME/jre/bin, where $JAVA_HOME can be anywhere. In order for shebang to work, the user needs a fixed location for jjs. Ideally, a symbolic link from a directory like /usr/bin . Use example;
#!/usr/bin/jjs
#
print(arguments.join(","));
We've provided instruction in the Nashorn User Guide for users to manually set up the symbolic link "sudo ln –s jjs $JAVA_HOME/bin/jre/jjs". However, for Nashorn shell scripting to become prevalent, the JRE/JDK installers should create this link. This is already done by perl, python, ruby, ... installers (Note on Mac OS X, java, javac, jrunscript have symbolic links in /usr/bin - historically supplied by Apple.)
This is potential huge for promoting broad use of the JVM via Nashorn.
The problem is that jjs floats around in $JAVA_HOME/bin/ or $JAVA_HOME/jre/bin, where $JAVA_HOME can be anywhere. In order for shebang to work, the user needs a fixed location for jjs. Ideally, a symbolic link from a directory like /usr/bin . Use example;
#!/usr/bin/jjs
#
print(arguments.join(","));
We've provided instruction in the Nashorn User Guide for users to manually set up the symbolic link "sudo ln –s jjs $JAVA_HOME/bin/jre/jjs". However, for Nashorn shell scripting to become prevalent, the JRE/JDK installers should create this link. This is already done by perl, python, ruby, ... installers (Note on Mac OS X, java, javac, jrunscript have symbolic links in /usr/bin - historically supplied by Apple.)
- relates to
-
JDK-8004109 (launcher) Need a tool to launch JavaScript files from the command line
- Closed