blob: 04f8028c3841af22604bacb0ac0eb8704a582cc5 [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.
rgallardf71f2512015-02-02 10:12:21 -08003.\" 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
mfangf2cf0062015-07-15 12:12:46 -070011.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
rgallardf71f2512015-02-02 10:12:21 -080012.\" 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
rgallardb6435452013-11-25 20:19:02 -080031.\"
32.if n .pl 99999
rgallardf71f2512015-02-02 10:12:21 -080033.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"
rgallardb6435452013-11-25 20:19:02 -080054jjs \- Invokes the Nashorn engine\&.
rgallardf71f2512015-02-02 10:12:21 -080055.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
rgallardb6435452013-11-25 20:19:02 -080067\fIoptions\fR
rgallardf71f2512015-02-02 10:12:21 -080068.RS 4
69One or more options of the
70\fBjjs\fR
71command, separated by spaces\&. For more information, see Options\&.
72.RE
73.PP
74\fIscript\-files\fR
75.RS 4
rgallardb6435452013-11-25 20:19:02 -080076One 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 -080077.RE
78.PP
rgallardb6435452013-11-25 20:19:02 -080079\fIarguments\fR
rgallardf71f2512015-02-02 10:12:21 -080080.RS 4
81All 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
83property (see Example 3)\&.
84.RE
85.SH "DESCRIPTION"
86.PP
87The
88\fBjjs\fR
89command\-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
92The options of the
93\fBjjs\fR
94command control the conditions under which scripts are interpreted by Nashorn\&.
95.PP
96\-cp \fIpath\fR
rgallardb6435452013-11-25 20:19:02 -080097.br
rgallardf71f2512015-02-02 10:12:21 -080098\-classpath \fIpath\fR
99.RS 4
rgallardb6435452013-11-25 20:19:02 -0800100Specifies 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 -0800101.RE
102.PP
103\-D\fIname\fR=\fIvalue\fR
104.RS 4
105Sets 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
107to 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.\}
rgallardb6435452013-11-25 20:19:02 -0800123This option can be repeated to set multiple properties\&.
rgallardf71f2512015-02-02 10:12:21 -0800124.RE
125.PP
126\-doe
rgallardb6435452013-11-25 20:19:02 -0800127.br
rgallardf71f2512015-02-02 10:12:21 -0800128\-\-dump\-on\-error
129.RS 4
rgallard04b0ca42014-10-17 11:33:22 -0700130Provides a full stack trace when an error occurs\&. By default, only a brief error message is printed\&.
rgallardf71f2512015-02-02 10:12:21 -0800131.RE
132.PP
133\-fv
rgallardb6435452013-11-25 20:19:02 -0800134.br
rgallardf71f2512015-02-02 10:12:21 -0800135\-\-fullversion
136.RS 4
rgallardb6435452013-11-25 20:19:02 -0800137Prints the full Nashorn version string\&.
rgallardf71f2512015-02-02 10:12:21 -0800138.RE
139.PP
140\-fx
141.RS 4
rgallardb6435452013-11-25 20:19:02 -0800142Launches the script as a JavaFX application\&.
rgallardf71f2512015-02-02 10:12:21 -0800143.RE
144.PP
145\-h
rgallardb6435452013-11-25 20:19:02 -0800146.br
rgallardf71f2512015-02-02 10:12:21 -0800147\-help
148.RS 4
rgallardb6435452013-11-25 20:19:02 -0800149Prints the list of options and their descriptions\&.
rgallardf71f2512015-02-02 10:12:21 -0800150.RE
151.PP
152\-\-language=[es5]
153.RS 4
rgallard04b0ca42014-10-17 11:33:22 -0700154Specifies the ECMAScript language version\&. The default version is ES5\&.
rgallardf71f2512015-02-02 10:12:21 -0800155.RE
156.PP
157\-ot
rgallardb6435452013-11-25 20:19:02 -0800158.br
rgallardf71f2512015-02-02 10:12:21 -0800159\-\-optimistic\-types=[true|false]
160.RS 4
rgallard04b0ca42014-10-17 11:33:22 -0700161Enables 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 -0800162.RE
163.PP
164\-scripting
165.RS 4
rgallardb6435452013-11-25 20:19:02 -0800166Enables shell scripting features\&.
rgallardf71f2512015-02-02 10:12:21 -0800167.RE
168.PP
169\-strict
170.RS 4
rgallardb6435452013-11-25 20:19:02 -0800171Enables 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 -0800172.RE
173.PP
174\-t=\fIzone\fR
rgallardb6435452013-11-25 20:19:02 -0800175.br
rgallardf71f2512015-02-02 10:12:21 -0800176\-timezone=\fIzone\fR
177.RS 4
178Sets the specified time zone for script execution\&. It overrides the time zone set in the OS and used by the
179\fBDate\fR
180object\&.
181.RE
182.PP
183\-v
rgallardb6435452013-11-25 20:19:02 -0800184.br
rgallardf71f2512015-02-02 10:12:21 -0800185\-version
186.RS 4
rgallardb6435452013-11-25 20:19:02 -0800187Prints the Nashorn version string\&.
rgallardf71f2512015-02-02 10:12:21 -0800188.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
rgallardb6435452013-11-25 20:19:02 -0800245.br
rgallardf71f2512015-02-02 10:12:21 -0800246'pl 8.5i
247'bp