jjs.1 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. '\" t
  2. .\" Copyright (c) 1994, 2015, Oracle and/or its affiliates. All rights reserved.
  3. .\"
  4. .\" Title: jjs
  5. .\" Language: English
  6. .\" Date: 03 March 2015
  7. .\" SectDesc: Basic Tools
  8. .\" Software: JDK 8
  9. .\" Arch: generic
  10. .\" Part Number: E38209-04
  11. .\" Doc ID: JSSOR
  12. .\"
  13. .if n .pl 99999
  14. .TH "jjs" "1" "03 March 2015" "JDK 8" "Basic Tools"
  15. .\" -----------------------------------------------------------------
  16. .\" * Define some portability stuff
  17. .\" -----------------------------------------------------------------
  18. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  19. .\" http://bugs.debian.org/507673
  20. .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
  21. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  22. .ie \n(.g .ds Aq \(aq
  23. .el .ds Aq '
  24. .\" -----------------------------------------------------------------
  25. .\" * set default formatting
  26. .\" -----------------------------------------------------------------
  27. .\" disable hyphenation
  28. .nh
  29. .\" disable justification (adjust text to left margin only)
  30. .ad l
  31. .\" -----------------------------------------------------------------
  32. .\" * MAIN CONTENT STARTS HERE *
  33. .\" -----------------------------------------------------------------
  34. .SH "NAME"
  35. jjs \- Invokes the Nashorn engine\&.
  36. .SH "SYNOPSIS"
  37. .sp
  38. .if n \{\
  39. .RS 4
  40. .\}
  41. .nf
  42. \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
  43. .fi
  44. .if n \{\
  45. .RE
  46. .\}
  47. .PP
  48. \fIoptions\fR
  49. .RS 4
  50. One or more options of the
  51. \fBjjs\fR
  52. command, separated by spaces\&. For more information, see Options\&.
  53. .RE
  54. .PP
  55. \fIscript\-files\fR
  56. .RS 4
  57. 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\&.
  58. .RE
  59. .PP
  60. \fIarguments\fR
  61. .RS 4
  62. 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
  63. \fBarguments\fR
  64. property (see Example 3)\&.
  65. .RE
  66. .SH "DESCRIPTION"
  67. .PP
  68. The
  69. \fBjjs\fR
  70. 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\&.
  71. .SH "OPTIONS"
  72. .PP
  73. The options of the
  74. \fBjjs\fR
  75. command control the conditions under which scripts are interpreted by Nashorn\&.
  76. .PP
  77. \-cp \fIpath\fR
  78. .br
  79. \-classpath \fIpath\fR
  80. .RS 4
  81. 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 (:)\&.
  82. .RE
  83. .PP
  84. \-D\fIname\fR=\fIvalue\fR
  85. .RS 4
  86. 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
  87. \fBmyValue\fR
  88. to the property named
  89. \fBmyKey\fR:
  90. .sp
  91. .if n \{\
  92. .RS 4
  93. .\}
  94. .nf
  95. \fB>> \fR\fB\fBjjs \-DmyKey=myValue\fR\fR
  96. \fBjjs> \fR\fB\fBjava\&.lang\&.System\&.getProperty("myKey")\fR\fR
  97. \fBmyValue\fR
  98. \fBjjs>\fR
  99. .fi
  100. .if n \{\
  101. .RE
  102. .\}
  103. This option can be repeated to set multiple properties\&.
  104. .RE
  105. .PP
  106. \-doe
  107. .br
  108. \-\-dump\-on\-error
  109. .RS 4
  110. Provides a full stack trace when an error occurs\&. By default, only a brief error message is printed\&.
  111. .RE
  112. .PP
  113. \-fv
  114. .br
  115. \-\-fullversion
  116. .RS 4
  117. Prints the full Nashorn version string\&.
  118. .RE
  119. .PP
  120. \-fx
  121. .RS 4
  122. Launches the script as a JavaFX application\&.
  123. .RE
  124. .PP
  125. \-h
  126. .br
  127. \-help
  128. .RS 4
  129. Prints the list of options and their descriptions\&.
  130. .RE
  131. .PP
  132. \-\-language=[es5]
  133. .RS 4
  134. Specifies the ECMAScript language version\&. The default version is ES5\&.
  135. .RE
  136. .PP
  137. \-ot
  138. .br
  139. \-\-optimistic\-types=[true|false]
  140. .RS 4
  141. Enables or disables optimistic type assumptions with deoptimizing recompilation\&. Running with optimistic types will yield higher final speed, but may increase warmup time\&.
  142. .RE
  143. .PP
  144. \-scripting
  145. .RS 4
  146. Enables shell scripting features\&.
  147. .RE
  148. .PP
  149. \-strict
  150. .RS 4
  151. Enables strict mode, which enforces stronger adherence to the standard (ECMAScript Edition 5\&.1), making it easier to detect common coding errors\&.
  152. .RE
  153. .PP
  154. \-t=\fIzone\fR
  155. .br
  156. \-timezone=\fIzone\fR
  157. .RS 4
  158. Sets the specified time zone for script execution\&. It overrides the time zone set in the OS and used by the
  159. \fBDate\fR
  160. object\&.
  161. .RE
  162. .PP
  163. \-v
  164. .br
  165. \-version
  166. .RS 4
  167. Prints the Nashorn version string\&.
  168. .RE
  169. .SH "EXAMPLES"
  170. .PP
  171. \fBExample 1 \fRRunning a Script with Nashorn
  172. .RS 4
  173. .sp
  174. .if n \{\
  175. .RS 4
  176. .\}
  177. .nf
  178. \fBjjs script\&.js\fR
  179. .fi
  180. .if n \{\
  181. .RE
  182. .\}
  183. .RE
  184. .PP
  185. \fBExample 2 \fRRunning Nashorn in Interactive Mode
  186. .RS 4
  187. .sp
  188. .if n \{\
  189. .RS 4
  190. .\}
  191. .nf
  192. \fB>> \fR\fB\fBjjs\fR\fR
  193. \fBjjs> \fR\fB\fBprintln("Hello, World!")\fR\fR
  194. \fBHello, World!\fR
  195. \fBjjs> \fR\fB\fBquit()\fR\fR
  196. \fB>>\fR
  197. .fi
  198. .if n \{\
  199. .RE
  200. .\}
  201. .RE
  202. .PP
  203. \fBExample 3 \fRPassing Arguments to Nashorn
  204. .RS 4
  205. .sp
  206. .if n \{\
  207. .RS 4
  208. .\}
  209. .nf
  210. \fB>> \fR\fB\fBjjs \-\- a b c\fR\fR
  211. \fBjjs> \fR\fB\fBarguments\&.join(", ")\fR\fR
  212. \fBa, b, c\fR
  213. \fBjjs>\fR
  214. .fi
  215. .if n \{\
  216. .RE
  217. .\}
  218. .RE
  219. .SH "SEE ALSO"
  220. .PP
  221. \fBjrunscript\fR
  222. .br
  223. 'pl 8.5i
  224. 'bp