blob: 85dbb7a24d9c0dd5c119fd4bac92c4f7ea1f51de [file] [log] [blame]
rgallardb6435452013-11-25 20:19:02 -08001'\" t
rgallardf71f2512015-02-02 10:12:21 -08002.\" 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
rgallardb6435452013-11-25 20:19:02 -080032.\"
33.if n .pl 99999
rgallardf71f2512015-02-02 10:12:21 -080034.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"
rgallardb6435452013-11-25 20:19:02 -080055jjs \- Invokes the Nashorn engine\&.
rgallardf71f2512015-02-02 10:12:21 -080056.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
rgallardb6435452013-11-25 20:19:02 -080068\fIoptions\fR
rgallardf71f2512015-02-02 10:12:21 -080069.RS 4
70One or more options of the
71\fBjjs\fR
72command, separated by spaces\&. For more information, see Options\&.
73.RE
74.PP
75\fIscript\-files\fR
76.RS 4
rgallardb6435452013-11-25 20:19:02 -080077One or more script files which you want to interpret using Nashorn, separated by spaces\&. If no files are specified, an interactive shell is started\&.
rgallardf71f2512015-02-02 10:12:21 -080078.RE
79.PP
rgallardb6435452013-11-25 20:19:02 -080080\fIarguments\fR
rgallardf71f2512015-02-02 10:12:21 -080081.RS 4
82All 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
84property (see Example 3)\&.
85.RE
86.SH "DESCRIPTION"
87.PP
88The
89\fBjjs\fR
90command\-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
93The options of the
94\fBjjs\fR
95command control the conditions under which scripts are interpreted by Nashorn\&.
96.PP
97\-cp \fIpath\fR
rgallardb6435452013-11-25 20:19:02 -080098.br
rgallardf71f2512015-02-02 10:12:21 -080099\-classpath \fIpath\fR
100.RS 4
rgallardb6435452013-11-25 20:19:02 -0800101Specifies 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 (:)\&.
rgallardf71f2512015-02-02 10:12:21 -0800102.RE
103.PP
104\-D\fIname\fR=\fIvalue\fR
105.RS 4
106Sets 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
108to 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.\}
rgallardb6435452013-11-25 20:19:02 -0800124This option can be repeated to set multiple properties\&.
rgallardf71f2512015-02-02 10:12:21 -0800125.RE
126.PP
127\-doe
rgallardb6435452013-11-25 20:19:02 -0800128.br
rgallardf71f2512015-02-02 10:12:21 -0800129\-\-dump\-on\-error
130.RS 4
rgallard04b0ca42014-10-17 11:33:22 -0700131Provides a full stack trace when an error occurs\&. By default, only a brief error message is printed\&.
rgallardf71f2512015-02-02 10:12:21 -0800132.RE
133.PP
134\-fv
rgallardb6435452013-11-25 20:19:02 -0800135.br
rgallardf71f2512015-02-02 10:12:21 -0800136\-\-fullversion
137.RS 4
rgallardb6435452013-11-25 20:19:02 -0800138Prints the full Nashorn version string\&.
rgallardf71f2512015-02-02 10:12:21 -0800139.RE
140.PP
141\-fx
142.RS 4
rgallardb6435452013-11-25 20:19:02 -0800143Launches the script as a JavaFX application\&.
rgallardf71f2512015-02-02 10:12:21 -0800144.RE
145.PP
146\-h
rgallardb6435452013-11-25 20:19:02 -0800147.br
rgallardf71f2512015-02-02 10:12:21 -0800148\-help
149.RS 4
rgallardb6435452013-11-25 20:19:02 -0800150Prints the list of options and their descriptions\&.
rgallardf71f2512015-02-02 10:12:21 -0800151.RE
152.PP
153\-\-language=[es5]
154.RS 4
rgallard04b0ca42014-10-17 11:33:22 -0700155Specifies the ECMAScript language version\&. The default version is ES5\&.
rgallardf71f2512015-02-02 10:12:21 -0800156.RE
157.PP
158\-ot
rgallardb6435452013-11-25 20:19:02 -0800159.br
rgallardf71f2512015-02-02 10:12:21 -0800160\-\-optimistic\-types=[true|false]
161.RS 4
rgallard04b0ca42014-10-17 11:33:22 -0700162Enables or disables optimistic type assumptions with deoptimizing recompilation\&. Running with optimistic types will yield higher final speed, but may increase warmup time\&.
rgallardf71f2512015-02-02 10:12:21 -0800163.RE
164.PP
165\-scripting
166.RS 4
rgallardb6435452013-11-25 20:19:02 -0800167Enables shell scripting features\&.
rgallardf71f2512015-02-02 10:12:21 -0800168.RE
169.PP
170\-strict
171.RS 4
rgallardb6435452013-11-25 20:19:02 -0800172Enables strict mode, which enforces stronger adherence to the standard (ECMAScript Edition 5\&.1), making it easier to detect common coding errors\&.
rgallardf71f2512015-02-02 10:12:21 -0800173.RE
174.PP
175\-t=\fIzone\fR
rgallardb6435452013-11-25 20:19:02 -0800176.br
rgallardf71f2512015-02-02 10:12:21 -0800177\-timezone=\fIzone\fR
178.RS 4
179Sets the specified time zone for script execution\&. It overrides the time zone set in the OS and used by the
180\fBDate\fR
181object\&.
182.RE
183.PP
184\-v
rgallardb6435452013-11-25 20:19:02 -0800185.br
rgallardf71f2512015-02-02 10:12:21 -0800186\-version
187.RS 4
rgallardb6435452013-11-25 20:19:02 -0800188Prints the Nashorn version string\&.
rgallardf71f2512015-02-02 10:12:21 -0800189.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
rgallardb6435452013-11-25 20:19:02 -0800246.br
rgallardf71f2512015-02-02 10:12:21 -0800247'pl 8.5i
248'bp