blob: 1c1fdf4dcefabb236d444df2b0fc7f11ca7e89ed [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
<head>
<meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2007. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<link rel="stylesheet" href="../book.css" charset="ISO-8859-1" type="text/css">
<title>Creating a Java application launch configuration</title>
<script language="JavaScript" src="PLUGINS_ROOT/org.eclipse.help/livehelp.js"> </script>
</head>
<body>
<h1> Creating a Java application launch configuration </h1>
<p> When you choose <strong>Run &gt;Run As &gt;Java Application </strong>to
launch your class, you are running your class using a generic <strong>Java
Application</strong> launch configuration that derives most of the launch
parameters from your Java project and your workbench preferences.&nbsp; In
some cases, you will want to override the derived parameters or specify
additional arguments. </p>
<p> You do this by creating your own <strong>Java Application</strong> launch
configuration.&nbsp; </p>
<ol>
<li> Select <a class="command-link" href='javascript:executeCommand("org.eclipse.debug.ui.commands.OpenRunConfigurations")'> <img src="PLUGINS_ROOT/org.eclipse.help/command_link.png" alt="Opens the Run Launch Configurations dialog"> <strong>Run &gt; Run...</strong></a> or <a class="command-link" href='javascript:executeCommand("org.eclipse.debug.ui.commands.OpenDebugConfigurations")'> <img src="PLUGINS_ROOT/org.eclipse.help/command_link.png" alt="Opens the Debug Launch Configurations dialog"> <strong>Run &gt; Debug...</strong></a> from the workbench menu bar.&nbsp; This opens a dialog that lets you
create, modify, and delete launch configurations of different types. </li>
<li> Select <strong>Java Application</strong> in the left hand list of launch
configuration types, and press the <strong>New</strong> button in the toolbar.
This will create a new launch configuration for a Java application.&nbsp;The
tabs on the right hand side allow you control specific aspects of the launch. </li>
</ol>
<blockquote>
<ul>
<li>The <strong>Main</strong> tab defines the class to be launched. Enter
the name of the project containing the class to launch in the project field,
and the fully qualified name of the main class in the Main class field.&nbsp;Check
the <strong>Stop in main</strong> checkbox if you want the program to stop
in the main method whenever the program is launched in debug mode.<br>
Note:&nbsp; You do not have to specify a project, but doing so allows a
default classpath, source lookup path, and JRE to be chosen.</li>
<li>The <strong>Arguments</strong> tab defines the arguments to be passed
to the application and to the virtual machine (if any). You can also specify
the working directory to be used by the launched application.</li>
<li>The <strong>JRE</strong> tab defines the JRE used to run or debug the
application. You can select a JRE from the already defined JREs, or define
a new JRE.</li>
<li>The <strong>Classpath</strong> tab defines the location of class files
used when running or debugging an application. By default, the user and
bootstrap class locations are derived from the associated project's build
path. You may override these settings here.</li>
<li>The <strong>Source</strong> tab defines the location of source files used
to display source when debugging a Java application. By default, these settings
are derived from the associated project's build path. You may override these
settings here.</li>
<li>The <strong>Environment</strong> tab defines the environment variable
values to use when running or debugging a Java application. By default,
the environment is inherited from the Eclipse runtime. You may override
or append to the inherited environment. </li>
<li>The <strong>Common</strong> tab defines general information about the
launch configuration.&nbsp; You may choose to store the launch configuration
in a specific file and specify which perspectives become active when the
launch configuration is launched.</li>
</ul>
</blockquote>
<p> <img border="0" src="../images/ngrelc.png" alt="Related concepts" > </p>
<p> <a href="../concepts/cdebugger.htm">Debugger</a><br>
<a href="../concepts/clocdbug.htm">Local debugging</a> </p>
<p> <br>
<img border="0" src="../images/ngrelt.png" alt="Related tasks" > </p>
<p> <a href="task-choose_config_jre.htm">Choosing a JRE for launching a project</a><br>
<a href="task-launching_java_program.htm">Launching a Java program</a><br>
<a href="tasks-executionArgs.htm">Setting execution arguments<br>
</a><a href="../tasks/tasks-9.htm">Changing debugger launch options</a> </p>
<p> <img border="0" src="../images/ngrelr.png" alt="Related reference" > </p>
<p> <a href="../reference/preferences/run-debug/ref-run_debug.htm">Debug preferences</a><br>
<a href="../reference/views/debug/ref-debug_view.htm">Debug view</a><br>
<a href="../reference/menus/run/ref-menu-run.htm">Run Menu </a> </p>
</body>
</html>