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