PageRenderTime 127ms CodeModel.GetById 120ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/www/tags/NOV_07_2009/htdocs/42docs/users-guide/starting.xml

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