Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8015420

jjs in /usr/bin

XMLWordPrintable

    • 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.)

            asemenyuk Alexey Semenyuk
            jlaskey Jim Laskey
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: