rgallard | b643545 | 2013-11-25 20:19:02 -0800 | [diff] [blame] | 1 | '\" t |
rgallard | f71f251 | 2015-02-02 10:12:21 -0800 | [diff] [blame] | 2 | .\" Copyright (c) 1994, 2015, Oracle and/or its affiliates. All rights reserved. |
rgallard | f71f251 | 2015-02-02 10:12:21 -0800 | [diff] [blame] | 3 | .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
| 4 | .\" |
| 5 | .\" This code is free software; you can redistribute it and/or modify it |
| 6 | .\" under the terms of the GNU General Public License version 2 only, as |
| 7 | .\" published by the Free Software Foundation. |
| 8 | .\" |
| 9 | .\" This code is distributed in the hope that it will be useful, but WITHOUT |
| 10 | .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
mfang | f2cf006 | 2015-07-15 12:12:46 -0700 | [diff] [blame] | 11 | .\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
rgallard | f71f251 | 2015-02-02 10:12:21 -0800 | [diff] [blame] | 12 | .\" version 2 for more details (a copy is included in the LICENSE file that |
| 13 | .\" accompanied this code). |
| 14 | .\" |
| 15 | .\" You should have received a copy of the GNU General Public License version |
| 16 | .\" 2 along with this work; if not, write to the Free Software Foundation, |
| 17 | .\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
| 18 | .\" |
| 19 | .\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
| 20 | .\" or visit www.oracle.com if you need additional information or have any |
| 21 | .\" questions. |
| 22 | .\" |
| 23 | .\" Title: jjs |
| 24 | .\" Language: English |
| 25 | .\" Date: 03 March 2015 |
| 26 | .\" SectDesc: Basic Tools |
| 27 | .\" Software: JDK 8 |
| 28 | .\" Arch: generic |
| 29 | .\" Part Number: E38207-04 |
| 30 | .\" Doc ID: JSSON |
rgallard | b643545 | 2013-11-25 20:19:02 -0800 | [diff] [blame] | 31 | .\" |
| 32 | .if n .pl 99999 |
rgallard | f71f251 | 2015-02-02 10:12:21 -0800 | [diff] [blame] | 33 | .TH "jjs" "1" "03 March 2015" "JDK 8" "Basic Tools" |
| 34 | .\" ----------------------------------------------------------------- |
| 35 | .\" * Define some portability stuff |
| 36 | .\" ----------------------------------------------------------------- |
| 37 | .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 38 | .\" http://bugs.debian.org/507673 |
| 39 | .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html |
| 40 | .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 41 | .ie \n(.g .ds Aq \(aq |
| 42 | .el .ds Aq ' |
| 43 | .\" ----------------------------------------------------------------- |
| 44 | .\" * set default formatting |
| 45 | .\" ----------------------------------------------------------------- |
| 46 | .\" disable hyphenation |
| 47 | .nh |
| 48 | .\" disable justification (adjust text to left margin only) |
| 49 | .ad l |
| 50 | .\" ----------------------------------------------------------------- |
| 51 | .\" * MAIN CONTENT STARTS HERE * |
| 52 | .\" ----------------------------------------------------------------- |
| 53 | .SH "NAME" |
rgallard | b643545 | 2013-11-25 20:19:02 -0800 | [diff] [blame] | 54 | jjs \- Invokes the Nashorn engine\&. |
rgallard | f71f251 | 2015-02-02 10:12:21 -0800 | [diff] [blame] | 55 | .SH "SYNOPSIS" |
| 56 | .sp |
| 57 | .if n \{\ |
| 58 | .RS 4 |
| 59 | .\} |
| 60 | .nf |
| 61 | \fB\fBjjs\fR\fR\fB [\fR\fB\fIoptions\fR\fR\fB] [\fR\fB\fIscript\-files\fR\fR\fB] [\-\- \fR\fB\fIarguments\fR\fR\fB]\fR |
| 62 | .fi |
| 63 | .if n \{\ |
| 64 | .RE |
| 65 | .\} |
| 66 | .PP |
rgallard | b643545 | 2013-11-25 20:19:02 -0800 | [diff] [blame] | 67 | \fIoptions\fR |
rgallard | f71f251 | 2015-02-02 10:12:21 -0800 | [diff] [blame] | 68 | .RS 4 |
| 69 | One or more options of the |
| 70 | \fBjjs\fR |
| 71 | command, separated by spaces\&. For more information, see Options\&. |
| 72 | .RE |
| 73 | .PP |
| 74 | \fIscript\-files\fR |
| 75 | .RS 4 |
rgallard | b643545 | 2013-11-25 20:19:02 -0800 | [diff] [blame] | 76 | One or more script files which you want to interpret using Nashorn, separated by spaces\&. If no files are specified, an interactive shell is started\&. |
rgallard | f71f251 | 2015-02-02 10:12:21 -0800 | [diff] [blame] | 77 | .RE |
| 78 | .PP |
rgallard | b643545 | 2013-11-25 20:19:02 -0800 | [diff] [blame] | 79 | \fIarguments\fR |
rgallard | f71f251 | 2015-02-02 10:12:21 -0800 | [diff] [blame] | 80 | .RS 4 |
| 81 | All values after the double hyphen marker (\fB\-\-\fR) are passed through to the script or the interactive shell as arguments\&. These values can be accessed by using the |
| 82 | \fBarguments\fR |
| 83 | property (see Example 3)\&. |
| 84 | .RE |
| 85 | .SH "DESCRIPTION" |
| 86 | .PP |
| 87 | The |
| 88 | \fBjjs\fR |
| 89 | command\-line tool is used to invoke the Nashorn engine\&. You can use it to interpret one or several script files, or to run an interactive shell\&. |
| 90 | .SH "OPTIONS" |
| 91 | .PP |
| 92 | The options of the |
| 93 | \fBjjs\fR |
| 94 | command control the conditions under which scripts are interpreted by Nashorn\&. |
| 95 | .PP |
| 96 | \-cp \fIpath\fR |
rgallard | b643545 | 2013-11-25 20:19:02 -0800 | [diff] [blame] | 97 | .br |
rgallard | f71f251 | 2015-02-02 10:12:21 -0800 | [diff] [blame] | 98 | \-classpath \fIpath\fR |
| 99 | .RS 4 |
rgallard | b643545 | 2013-11-25 20:19:02 -0800 | [diff] [blame] | 100 | Specifies the path to the supporting class files To set multiple paths, the option can be repeated, or you can separate each path with a colon (:)\&. |
rgallard | f71f251 | 2015-02-02 10:12:21 -0800 | [diff] [blame] | 101 | .RE |
| 102 | .PP |
| 103 | \-D\fIname\fR=\fIvalue\fR |
| 104 | .RS 4 |
| 105 | Sets a system property to be passed to the script by assigning a value to a property name\&. The following example shows how to invoke Nashorn in interactive mode and assign |
| 106 | \fBmyValue\fR |
| 107 | to the property named |
| 108 | \fBmyKey\fR: |
| 109 | .sp |
| 110 | .if n \{\ |
| 111 | .RS 4 |
| 112 | .\} |
| 113 | .nf |
| 114 | \fB>> \fR\fB\fBjjs \-DmyKey=myValue\fR\fR |
| 115 | \fBjjs> \fR\fB\fBjava\&.lang\&.System\&.getProperty("myKey")\fR\fR |
| 116 | \fBmyValue\fR |
| 117 | \fBjjs>\fR |
| 118 | |
| 119 | .fi |
| 120 | .if n \{\ |
| 121 | .RE |
| 122 | .\} |
rgallard | b643545 | 2013-11-25 20:19:02 -0800 | [diff] [blame] | 123 | This option can be repeated to set multiple properties\&. |
rgallard | f71f251 | 2015-02-02 10:12:21 -0800 | [diff] [blame] | 124 | .RE |
| 125 | .PP |
| 126 | \-doe |
rgallard | b643545 | 2013-11-25 20:19:02 -0800 | [diff] [blame] | 127 | .br |
rgallard | f71f251 | 2015-02-02 10:12:21 -0800 | [diff] [blame] | 128 | \-\-dump\-on\-error |
| 129 | .RS 4 |
rgallard | 04b0ca4 | 2014-10-17 11:33:22 -0700 | [diff] [blame] | 130 | Provides a full stack trace when an error occurs\&. By default, only a brief error message is printed\&. |
rgallard | f71f251 | 2015-02-02 10:12:21 -0800 | [diff] [blame] | 131 | .RE |
| 132 | .PP |
| 133 | \-fv |
rgallard | b643545 | 2013-11-25 20:19:02 -0800 | [diff] [blame] | 134 | .br |
rgallard | f71f251 | 2015-02-02 10:12:21 -0800 | [diff] [blame] | 135 | \-\-fullversion |
| 136 | .RS 4 |
rgallard | b643545 | 2013-11-25 20:19:02 -0800 | [diff] [blame] | 137 | Prints the full Nashorn version string\&. |
rgallard | f71f251 | 2015-02-02 10:12:21 -0800 | [diff] [blame] | 138 | .RE |
| 139 | .PP |
| 140 | \-fx |
| 141 | .RS 4 |
rgallard | b643545 | 2013-11-25 20:19:02 -0800 | [diff] [blame] | 142 | Launches the script as a JavaFX application\&. |
rgallard | f71f251 | 2015-02-02 10:12:21 -0800 | [diff] [blame] | 143 | .RE |
| 144 | .PP |
| 145 | \-h |
rgallard | b643545 | 2013-11-25 20:19:02 -0800 | [diff] [blame] | 146 | .br |
rgallard | f71f251 | 2015-02-02 10:12:21 -0800 | [diff] [blame] | 147 | \-help |
| 148 | .RS 4 |
rgallard | b643545 | 2013-11-25 20:19:02 -0800 | [diff] [blame] | 149 | Prints the list of options and their descriptions\&. |
rgallard | f71f251 | 2015-02-02 10:12:21 -0800 | [diff] [blame] | 150 | .RE |
| 151 | .PP |
| 152 | \-\-language=[es5] |
| 153 | .RS 4 |
rgallard | 04b0ca4 | 2014-10-17 11:33:22 -0700 | [diff] [blame] | 154 | Specifies the ECMAScript language version\&. The default version is ES5\&. |
rgallard | f71f251 | 2015-02-02 10:12:21 -0800 | [diff] [blame] | 155 | .RE |
| 156 | .PP |
| 157 | \-ot |
rgallard | b643545 | 2013-11-25 20:19:02 -0800 | [diff] [blame] | 158 | .br |
rgallard | f71f251 | 2015-02-02 10:12:21 -0800 | [diff] [blame] | 159 | \-\-optimistic\-types=[true|false] |
| 160 | .RS 4 |
rgallard | 04b0ca4 | 2014-10-17 11:33:22 -0700 | [diff] [blame] | 161 | Enables or disables optimistic type assumptions with deoptimizing recompilation\&. Running with optimistic types will yield higher final speed, but may increase warmup time\&. |
rgallard | f71f251 | 2015-02-02 10:12:21 -0800 | [diff] [blame] | 162 | .RE |
| 163 | .PP |
| 164 | \-scripting |
| 165 | .RS 4 |
rgallard | b643545 | 2013-11-25 20:19:02 -0800 | [diff] [blame] | 166 | Enables shell scripting features\&. |
rgallard | f71f251 | 2015-02-02 10:12:21 -0800 | [diff] [blame] | 167 | .RE |
| 168 | .PP |
| 169 | \-strict |
| 170 | .RS 4 |
rgallard | b643545 | 2013-11-25 20:19:02 -0800 | [diff] [blame] | 171 | Enables strict mode, which enforces stronger adherence to the standard (ECMAScript Edition 5\&.1), making it easier to detect common coding errors\&. |
rgallard | f71f251 | 2015-02-02 10:12:21 -0800 | [diff] [blame] | 172 | .RE |
| 173 | .PP |
| 174 | \-t=\fIzone\fR |
rgallard | b643545 | 2013-11-25 20:19:02 -0800 | [diff] [blame] | 175 | .br |
rgallard | f71f251 | 2015-02-02 10:12:21 -0800 | [diff] [blame] | 176 | \-timezone=\fIzone\fR |
| 177 | .RS 4 |
| 178 | Sets the specified time zone for script execution\&. It overrides the time zone set in the OS and used by the |
| 179 | \fBDate\fR |
| 180 | object\&. |
| 181 | .RE |
| 182 | .PP |
| 183 | \-v |
rgallard | b643545 | 2013-11-25 20:19:02 -0800 | [diff] [blame] | 184 | .br |
rgallard | f71f251 | 2015-02-02 10:12:21 -0800 | [diff] [blame] | 185 | \-version |
| 186 | .RS 4 |
rgallard | b643545 | 2013-11-25 20:19:02 -0800 | [diff] [blame] | 187 | Prints the Nashorn version string\&. |
rgallard | f71f251 | 2015-02-02 10:12:21 -0800 | [diff] [blame] | 188 | .RE |
| 189 | .SH "EXAMPLES" |
| 190 | .PP |
| 191 | \fBExample 1 \fRRunning a Script with Nashorn |
| 192 | .RS 4 |
| 193 | .sp |
| 194 | .if n \{\ |
| 195 | .RS 4 |
| 196 | .\} |
| 197 | .nf |
| 198 | \fBjjs script\&.js\fR |
| 199 | |
| 200 | .fi |
| 201 | .if n \{\ |
| 202 | .RE |
| 203 | .\} |
| 204 | .RE |
| 205 | .PP |
| 206 | \fBExample 2 \fRRunning Nashorn in Interactive Mode |
| 207 | .RS 4 |
| 208 | .sp |
| 209 | .if n \{\ |
| 210 | .RS 4 |
| 211 | .\} |
| 212 | .nf |
| 213 | \fB>> \fR\fB\fBjjs\fR\fR |
| 214 | \fBjjs> \fR\fB\fBprintln("Hello, World!")\fR\fR |
| 215 | \fBHello, World!\fR |
| 216 | \fBjjs> \fR\fB\fBquit()\fR\fR |
| 217 | \fB>>\fR |
| 218 | |
| 219 | .fi |
| 220 | .if n \{\ |
| 221 | .RE |
| 222 | .\} |
| 223 | .RE |
| 224 | .PP |
| 225 | \fBExample 3 \fRPassing Arguments to Nashorn |
| 226 | .RS 4 |
| 227 | .sp |
| 228 | .if n \{\ |
| 229 | .RS 4 |
| 230 | .\} |
| 231 | .nf |
| 232 | \fB>> \fR\fB\fBjjs \-\- a b c\fR\fR |
| 233 | \fBjjs> \fR\fB\fBarguments\&.join(", ")\fR\fR |
| 234 | \fBa, b, c\fR |
| 235 | \fBjjs>\fR |
| 236 | |
| 237 | .fi |
| 238 | .if n \{\ |
| 239 | .RE |
| 240 | .\} |
| 241 | .RE |
| 242 | .SH "SEE ALSO" |
| 243 | .PP |
| 244 | \fBjrunscript\fR |
rgallard | b643545 | 2013-11-25 20:19:02 -0800 | [diff] [blame] | 245 | .br |
rgallard | f71f251 | 2015-02-02 10:12:21 -0800 | [diff] [blame] | 246 | 'pl 8.5i |
| 247 | 'bp |