1 '\" t
   2 .\" Copyright (c) 1994, 2015, Oracle and/or its affiliates. All rights reserved.
   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
  11 .\" FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  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
  31 .\"
  32 .if n .pl 99999
  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"
  54 jjs \- Invokes the Nashorn engine\&.
  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
  67 \fIoptions\fR
  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
  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\&.
  77 .RE
  78 .PP
  79 \fIarguments\fR
  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
  97 .br
  98 \-classpath \fIpath\fR
  99 .RS 4
 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 (:)\&.
 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 .\}
 123 This option can be repeated to set multiple properties\&.
 124 .RE
 125 .PP
 126 \-doe
 127 .br
 128 \-\-dump\-on\-error
 129 .RS 4
 130 Provides a full stack trace when an error occurs\&. By default, only a brief error message is printed\&.
 131 .RE
 132 .PP
 133 \-fv
 134 .br
 135 \-\-fullversion
 136 .RS 4
 137 Prints the full Nashorn version string\&.
 138 .RE
 139 .PP
 140 \-fx
 141 .RS 4
 142 Launches the script as a JavaFX application\&.
 143 .RE
 144 .PP
 145 \-h
 146 .br
 147 \-help
 148 .RS 4
 149 Prints the list of options and their descriptions\&.
 150 .RE
 151 .PP
 152 \-\-language=[es5]
 153 .RS 4
 154 Specifies the ECMAScript language version\&. The default version is ES5\&.
 155 .RE
 156 .PP
 157 \-ot
 158 .br
 159 \-\-optimistic\-types=[true|false]
 160 .RS 4
 161 Enables or disables optimistic type assumptions with deoptimizing recompilation\&. Running with optimistic types will yield higher final speed, but may increase warmup time\&.
 162 .RE
 163 .PP
 164 \-scripting
 165 .RS 4
 166 Enables shell scripting features\&.
 167 .RE
 168 .PP
 169 \-strict
 170 .RS 4
 171 Enables strict mode, which enforces stronger adherence to the standard (ECMAScript Edition 5\&.1), making it easier to detect common coding errors\&.
 172 .RE
 173 .PP
 174 \-t=\fIzone\fR
 175 .br
 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
 184 .br
 185 \-version
 186 .RS 4
 187 Prints the Nashorn version string\&.
 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
 245 .br
 246 'pl 8.5i
 247 'bp