/jEdit/branches/4.4.x/doc/users-guide/starting.xml

# · XML · 367 lines · 283 code · 81 blank · 3 comment · 0 complexity · 93a5f8141fc03a1e6b311c7fbe511738 MD5 · raw file

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <chapter id="starting">
  3. <title>Starting jEdit</title>
  4. <!-- jEdit buffer-local properties: -->
  5. <!-- :tabSize=1:indentSize=1:noTabs=true: -->
  6. <!-- :xml.root=users-guide.xml: -->
  7. <para>Exactly how jEdit is started depends on the operating system. For
  8. example, on Unix you can run <quote>jedit</quote> at the command line, or
  9. select jEdit from a menu; on Windows, you can double-click on the jEdit icon
  10. or select it from the <guimenu>Start</guimenu> menu. </para>
  11. <para>If jEdit is started while another copy is already running, control is
  12. transferred to the running copy, and a second instance is not loaded. This
  13. saves time and memory if jEdit is started multiple times. Communication
  14. between instances of jEdit is implemented using TCP/IP sockets; the initial
  15. instance is known as the <firstterm>server</firstterm>, and subsequent
  16. invocations are <firstterm>clients</firstterm>.</para>
  17. <para>If you find yourself launching and exiting jEdit a lot, the startup
  18. time can get a bit bothersome. If the <userinput>-background</userinput>
  19. command line switch is specified, jEdit will continue running and waiting
  20. for client requests even after all editor windows are closed. When run in
  21. background mode, you can open and close jEdit any number of times, only
  22. having to wait for it to start the first time. The downside of this is
  23. increased memory usage.</para>
  24. <para>When running on MacOS X, the <userinput>-background</userinput>
  25. command-line switch is active by default, so that jEdit conforms to the
  26. platform convention that programs should stay open until the
  27. <guimenuitem>Quit</guimenuitem> command is explicitly invoked by the user,
  28. even if all windows are closed. To disable background mode on MacOS X, use
  29. the <userinput>-nobackground</userinput> switch.</para>
  30. <para>For more information about command line switches that control the
  31. server feature, see <xref linkend="cli-usage" />. </para>
  32. <para>jEdit remembers open buffers, views and split window configurations
  33. between editing sessions, so you can get back to work immediately after
  34. starting jEdit. This feature can be disabled in the
  35. <guibutton>General</guibutton> pane of the
  36. <guimenu>Utilities</guimenu>&gt;<guimenuitem>Global Options</guimenuitem>
  37. dialog box see <xref linkend="general-pane" />.</para>
  38. <sidebar>
  39. <title>The edit server and security</title>
  40. <para>Since Java does not provide any interprocess communication
  41. facility other than TCP/IP, jEdit takes extra precautions to prevent
  42. remote attacks.</para>
  43. <para>Not only does the edit server pick a random TCP port number on
  44. startup, it also requires that clients provide an
  45. <firstterm>authorization key</firstterm>; a randomly-generated number
  46. only accessible to processes running on the local machine. So not only
  47. will <quote>bad guys</quote> have to guess a 64-bit integer, they will
  48. need to get it right on the first try; the edit server shuts itself off
  49. upon receiving an invalid packet.</para>
  50. <para>In environments that demand absolute security, the edit server can
  51. be disabled by specifying the <userinput>-noserver</userinput> command
  52. line switch.</para>
  53. </sidebar>
  54. <section id="cli-usage">
  55. <title>Command Line Usage</title>
  56. <para>On operating systems that support a command line, jEdit can be
  57. passed various arguments to control its behavior.</para>
  58. <para>When opening files from the command line, a line number or marker
  59. to position the caret on can be specified like so:</para>
  60. <screen><prompt>$ </prompt><userinput>jedit MyApplet.java +line:10</userinput>
  61. <prompt>$ </prompt><userinput>jedit thesis.tex +marker:c</userinput></screen>
  62. <para>Command-line switches begin with a "-". Some take a parameter. A
  63. file whose name begins with "-" can be opened like so:</para>
  64. <screen><prompt>$ </prompt><userinput>jedit -- -myfile</userinput></screen>
  65. <section>
  66. <title>Miscellaneous Options</title>
  67. <informaltable>
  68. <tgroup cols="2">
  69. <colspec colnum="1" colwidth="1.5in" />
  70. <colspec colwidth="*"/>
  71. <thead>
  72. <row>
  73. <entry>Option</entry>
  74. <entry>Effect</entry>
  75. </row>
  76. </thead>
  77. <tbody>
  78. <row>
  79. <entry><userinput>-log=<replaceable>level</replaceable></userinput></entry>
  80. <entry>Set the minimum log level to an integer
  81. between 1 and 9. Default is 7. Has no effect when
  82. connecting to another instance via the edit
  83. server.</entry>
  84. </row>
  85. <row>
  86. <entry><userinput>-usage</userinput></entry>
  87. <entry>Show a brief command line usage message
  88. without starting jEdit. This message is also shown if
  89. an invalid switch was specified.</entry>
  90. </row>
  91. <row>
  92. <entry><userinput>-version</userinput></entry>
  93. <entry>Show the version number without starting
  94. jEdit.</entry>
  95. </row>
  96. <row>
  97. <entry><userinput>--</userinput></entry>
  98. <entry>Specifies the end of command-line processing.
  99. Further parameters are treated as file names, even if
  100. they begin with a dash.</entry>
  101. </row>
  102. </tbody>
  103. </tgroup>
  104. </informaltable>
  105. </section>
  106. <section>
  107. <title>Configuration Options</title>
  108. <informaltable>
  109. <tgroup cols="2">
  110. <colspec colnum="1" colwidth="1.5in" />
  111. <colspec colwidth="*"/>
  112. <thead>
  113. <row>
  114. <entry>Option</entry>
  115. <entry>Effect</entry>
  116. </row>
  117. </thead>
  118. <tbody>
  119. <row>
  120. <entry><userinput>-plugins</userinput></entry>
  121. <entry>Enable loading of plugins. Has no effect when
  122. connecting to another instance via the edit server.
  123. See <xref linkend="using-plugins" />.</entry>
  124. </row>
  125. <row>
  126. <entry><userinput>-noplugins</userinput></entry>
  127. <entry>Disable loading of plugins. Has no effect when
  128. connecting to another instance via the edit
  129. server.</entry>
  130. </row>
  131. <row>
  132. <entry><userinput>-restore</userinput></entry>
  133. <entry>Restore previously open files on startup. This
  134. is the default. This feature can also be set
  135. permanently in the <guibutton>General</guibutton>
  136. pane of the
  137. <guimenu>Utilities</guimenu>&gt;<guimenuitem>Global
  138. Options</guimenuitem> dialog box; see <xref
  139. linkend="general-pane" />.</entry>
  140. </row>
  141. <row>
  142. <entry><userinput>-norestore</userinput></entry>
  143. <entry>Do not restore previously open files on
  144. startup.</entry>
  145. </row>
  146. <row>
  147. <entry><userinput>-run=<replaceable>script</replaceable></userinput></entry>
  148. <entry>Run the specified BeanShell script. There can
  149. only be one of these parameters on the command line.
  150. See <xref linkend="scripts-command-line" />.</entry>
  151. </row>
  152. <row>
  153. <entry><userinput>-settings=<replaceable>dir</replaceable></userinput></entry>
  154. <entry>Store user-specific settings in the directory
  155. named <replaceable>dir</replaceable>, instead of the
  156. default
  157. <filename><replaceable>user.home</replaceable>/.jedit</filename>.
  158. The directory will be created automatically if it
  159. does not exist. Has no effect when connecting to
  160. another instance via the edit server. See <xref
  161. linkend="settings-directory" />.</entry>
  162. </row>
  163. <row>
  164. <entry><userinput>-nosettings</userinput></entry>
  165. <entry>Start jEdit without loading user-specific
  166. settings.</entry>
  167. </row>
  168. <row>
  169. <entry><userinput>-startupscripts</userinput></entry>
  170. <entry>Run startup scripts. This is the default. Has
  171. no effect when connecting to another instance via the
  172. edit server. See <xref
  173. linkend="startup-scripts" />.</entry>
  174. </row>
  175. <row>
  176. <entry><userinput>-nostartupscripts</userinput></entry>
  177. <entry>Disable startup scripts. Has no effect when
  178. connecting to another instance via the edit
  179. server.</entry>
  180. </row>
  181. </tbody>
  182. </tgroup>
  183. </informaltable>
  184. </section>
  185. <section>
  186. <title>Edit Server Options</title>
  187. <para>See <xref linkend="starting" /> for a brief description of the
  188. edit server.</para>
  189. <informaltable>
  190. <tgroup cols="2">
  191. <colspec colnum="1" colwidth="1.5in" />
  192. <colspec colwidth="*"/>
  193. <thead>
  194. <row>
  195. <entry>Option</entry>
  196. <entry>Effect</entry>
  197. </row>
  198. </thead>
  199. <tbody>
  200. <row>
  201. <entry><userinput>-background</userinput></entry>
  202. <entry>Run jEdit in background mode. In background
  203. mode, the edit server will continue listening for
  204. client connections even after all views are closed.
  205. Has no effect when connecting to another instance via
  206. the edit server.</entry>
  207. </row>
  208. <row>
  209. <entry><userinput>-nobackground</userinput></entry>
  210. <entry>Disable background mode. This is the default.
  211. Has no effect when connecting to another instance via
  212. the edit server.</entry>
  213. </row>
  214. <row>
  215. <entry><userinput>-gui</userinput></entry>
  216. <entry>Open an initial view. This is the default. Has
  217. no effect when connecting to another instance via the
  218. edit server.</entry>
  219. </row>
  220. <row>
  221. <entry><userinput>-nogui</userinput></entry>
  222. <entry>Do not open an initial view, and instead only
  223. open one when the first client connects. Can only be
  224. used in combination with the
  225. <userinput>-background</userinput> switch. You can
  226. use this switch to <quote>pre-load</quote> jEdit when
  227. you log in to your computer, for example. Has no
  228. effect when connecting to another instance via the
  229. edit server.</entry>
  230. </row>
  231. <row>
  232. <entry><userinput>-newplainview</userinput></entry>
  233. <entry>Opens the specified files in a new plain view.
  234. For more information about views, see <xref
  235. linkend="views" />.</entry>
  236. </row>
  237. <row>
  238. <entry><userinput>-newview</userinput></entry>
  239. <entry>Opens the specified files in a new
  240. view.</entry>
  241. </row>
  242. <row>
  243. <entry><userinput>-reuseview</userinput></entry>
  244. <entry>Opens the specified files in an existing
  245. view.</entry>
  246. </row>
  247. <row>
  248. <entry><userinput>-quit</userinput></entry>
  249. <entry>Exits the currently running editor
  250. instance.</entry>
  251. </row>
  252. <row>
  253. <entry><userinput>-server</userinput></entry>
  254. <entry>Store the server port info in the file named
  255. <filename>server</filename> inside the settings
  256. directory.</entry>
  257. </row>
  258. <row>
  259. <entry><userinput>-server=<replaceable>name</replaceable></userinput></entry>
  260. <entry>Store the server port info in the file named
  261. <replaceable>name</replaceable>. File names for this
  262. parameter are relative to the settings
  263. directory.</entry>
  264. </row>
  265. <row>
  266. <entry><userinput>-noserver</userinput></entry>
  267. <entry>Do not attempt to connect to a running edit
  268. server, and do not start one either.</entry>
  269. </row>
  270. <row>
  271. <entry><userinput>-wait</userinput></entry>
  272. <entry>Keeps the client open until the user closes
  273. the specified buffer in the server instance. Does
  274. nothing if passed to the initial jEdit instance. Use
  275. this switch if jEdit is being invoked by another
  276. program as an external editor; otherwise the client
  277. will exit immediately and the invoking program will
  278. assume you have finished editing the given
  279. file.</entry>
  280. </row>
  281. </tbody>
  282. </tgroup>
  283. </informaltable>
  284. </section>
  285. </section>
  286. </chapter>