nashorn/README
changeset 43016 f78ab1eafdb9
parent 30981 7ef4e72901cf
child 43349 be6e40f785d7
equal deleted inserted replaced
42976:37b95df0042a 43016:f78ab1eafdb9
    22 
    22 
    23     hg clone https://bitbucket.org/gxti/hgforest
    23     hg clone https://bitbucket.org/gxti/hgforest
    24 
    24 
    25 You can clone Nashorn Mercurial forest using this command:
    25 You can clone Nashorn Mercurial forest using this command:
    26 
    26 
    27     hg fclone http://hg.openjdk.java.net/nashorn/jdk8 nashorn~jdk8
    27     hg fclone http://hg.openjdk.java.net/nashorn/jdk9 nashorn~jdk9
    28     
    28     
    29 To update your copy of the forest (fwith the latest code:
    29 To update your copy of the forest (fwith the latest code:
    30 
    30 
    31     (cd nashorn~jdk8 ; hg fpull)
    31     (cd nashorn~jdk9 ; hg fpull)
    32     
    32     
    33 Or just the nashorn subdirectory with
    33 Or just the nashorn subdirectory with
    34 
    34 
    35     (cd nashorn~jdk8/nashorn ; hg pull -u)
    35     (cd nashorn~jdk9/nashorn ; hg pull -u)
    36     
    36     
    37 To learn about Mercurial in detail, please visit http://hgbook.red-bean.com.
    37 To learn about Mercurial in detail, please visit http://hgbook.red-bean.com.
    38 
    38 
    39 - How to build?
    39 - How to build?
    40 
    40 
    41 To build Nashorn, you need to install JDK 8. You may use the Nashorn
    41 To build Nashorn, you need to install JDK 9. You may use the Nashorn
    42 forest build (recommended) or down load from java.net.  You will need to
    42 forest build (recommended) or down load from java.net.  You will need to
    43 set JAVA_HOME environmental variable to point to your JDK installation
    43 set JAVA_HOME environmental variable to point to your JDK installation
    44 directory.
    44 directory.
    45 
    45 
    46     cd nashorn~jdk8/nashorn/make
    46     cd nashorn~jdk9/nashorn/make
    47     ant clean; ant
    47     ant clean; ant
    48 
    48 
    49 - How to run?
    49 - How to run?
    50 
    50 
    51 Use the jjs script (see RELESE_README):
    51 Use the jjs script (see RELESE_README):
    52 
    52 
    53     cd nashorn~jdk8/nashorn
    53     cd nashorn~jdk9/nashorn
    54     sh bin/jjs <your .js file>
    54     sh bin/jjs <your .js file>
    55 
    55 
    56 Nashorn supports javax.script API. It is possible to drop nashorn.jar in
    56 Nashorn supports javax.script API. It is possible to drop nashorn.jar in
    57 class path and request for "nashorn" script engine from
    57 class path and request for "nashorn" script engine from
    58 javax.script.ScriptEngineManager. 
    58 javax.script.ScriptEngineManager. 
    62 - Documentation
    62 - Documentation
    63 
    63 
    64 Comprehensive development documentation is found in the Nashorn JavaDoc. You can
    64 Comprehensive development documentation is found in the Nashorn JavaDoc. You can
    65 build it using:
    65 build it using:
    66 
    66 
    67     cd nashorn~jdk8/nashorn/make
    67     cd nashorn~jdk9/nashorn/make
    68     ant javadoc
    68     ant javadoc
    69     
    69     
    70 after which you can view the generated documentation at dist/javadoc/index.html.
    70 after which you can view the generated documentation at dist/javadoc/index.html.
    71 
    71 
    72 - Running tests
    72 - Running tests
    88     
    88     
    89 Alternatively, you can check it out elsewhere and make
    89 Alternatively, you can check it out elsewhere and make
    90 test/script/external/test262 a symbolic link to that directory. After
    90 test/script/external/test262 a symbolic link to that directory. After
    91 you've done this, you can run the ECMA-262 tests using:
    91 you've done this, you can run the ECMA-262 tests using:
    92 
    92 
    93     cd nashorn~jdk8/nashorn/make
    93     cd nashorn~jdk9/nashorn/make
    94     ant test262
    94     ant test262
    95 
    95 
    96 Ant target to get/update external test suites:
    96 Ant target to get/update external test suites:
    97 
    97 
    98     ant externals
    98     ant externals
    99     ant update-externals
    99     ant update-externals
   100     
   100     
   101 These tests take time, so we have a parallelized runner for them that
   101 These tests take time, so we have a parallelized runner for them that
   102 takes advantage of all processor cores on the computer:
   102 takes advantage of all processor cores on the computer:
   103 
   103 
   104     cd nashorn~jdk8/nashorn/make
   104     cd nashorn~jdk9/nashorn/make
   105     ant test262parallel
   105     ant test262parallel
   106     
   106     
   107 - How to write your own test?
   107 - How to write your own test?
   108 
   108 
   109 Nashorn uses it's own simple test framework. Any .js file dropped under
   109 Nashorn uses it's own simple test framework. Any .js file dropped under