| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"> |
| <html> |
| <head> |
| <meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2005. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." > |
| <link rel="stylesheet" href="../book.css" charset="ISO-8859-1" type="text/css"> |
| <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
| <meta http-equiv="Content-Style-Type" content="text/css"> |
| <title> |
| Detecting existing layout |
| </title> |
| <script language="JavaScript" src="PLUGINS_ROOT/org.eclipse.help/livehelp.js"> </script> |
| </head> |
| <body> |
| <h1> |
| Detecting existing layout |
| </h1> |
| <h3>Layout on file system</h3> |
| <ul> |
| <li>The source files for a product are laid out in one directory "src".</li> |
| <li>The class files are in another directory "bin". |
| <p><img src="images/qs-DetectingExistingLayout1.png" alt="Layout on file system"></p></li> |
| </ul> |
| <h3>Steps for defining a corresponding project</h3> |
| <ol> |
| <li> |
| <p>Click |
| <a class="command-link" href='javascript:executeCommand("org.eclipse.ui.perspectives.showPerspective(org.eclipse.ui.perspectives.showPerspective.perspectiveId=org.eclipse.jdt.ui.JavaPerspective)")'> |
| <img src="PLUGINS_ROOT/org.eclipse.help/command_link.png" alt="Open Java perspective"> |
| <strong>Window > Open Perspective > Other... > Java</strong></a> |
| to change to the Java perspective. |
| </p> |
| </li> |
| <li> |
| <p> |
| Click |
| <a class="command-link" href='javascript:executeCommand("org.eclipse.ui.newWizard(newWizardId=org.eclipse.jdt.ui.wizards.JavaProjectWizard)")'> |
| <img src="PLUGINS_ROOT/org.eclipse.help/command_link.png" alt="Open new Java project wizard"> |
| <strong>File > New > Other... > Java Project</strong></a> |
| to open the <strong>New Java Project</strong> wizard. |
| </p> |
| </li> |
| <li> |
| <p>Type "Product" in the <strong>Project name</strong> field.</p> |
| </li> |
| <li> |
| <p>In <strong>Project layout</strong> group, change selection to <strong>Create separate source and output folders</strong>.</p> |
| <p>In <strong>Contents</strong> group, change selection to <strong>Create project from existing source</strong>.</p> |
| <p>Click <strong>Browse...</strong> and choose the <i><code>Product</code></i> directory on drive <i><code>D:</code></i>.</p> |
| <p><img src="images/qs-DetectingExistingLayout2.png" alt="New Java Project wizard"></p> |
| </li> |
| <li> |
| <p>Click <strong>Next</strong>.</p> |
| <p>Ensure that the source and output folders are detected.</p> |
| <p><img src="images/qs-DetectingExistingLayout3.png" alt="Java Project Source setup"></p> |
| <p> |
| <em>Warning: </em>If the <strong>Scrub output folders when cleaning projects</strong> preference in the |
| <strong>Output folder</strong> section of the |
| <a class="command-link" href='javascript:executeCommand("org.eclipse.ui.window.preferences(preferencePageId=org.eclipse.jdt.ui.preferences.JavaBuildPreferencePage)")'> |
| <img src="PLUGINS_ROOT/org.eclipse.help/command_link.png" alt="Goto the building preference page"> |
| <strong>Java > Compiler > Building</strong></a> preference page |
| is checked, clicking <strong>Finish</strong> will scrub the "bin" directory in the file system before |
| generating the class files. </p> |
| </li> |
| <li> |
| Click <strong>Finish</strong>. |
| </li> |
| <li> |
| You now have a Java project with a "src" folder which contains the sources of the "Product" directory. |
| <p><img src="images/qs-DetectingExistingLayout4.png" alt="Created Java project in Workspace"></p> |
| </li> |
| </ol> |
| <p> |
| <em>Note: </em>This solution creates a ".project" file and a ".classpath" file in the |
| "Product" directory. If you do not wish to have these files in the "Product" directory, |
| you should use linked folders as shown in the |
| <a href="qs-WorkingWithExistingLayout1.htm">Sibling products in a common source tree</a> section. |
| </p> |
| <P class="nav_footer" id="nav_footer">Next Section: <A href="qs-OrganizingSources.htm">Organizing sources</A> |
| </P> |
| <p> |
| <img border="0" src="../images/ngrelc.png" alt="Related concepts" > |
| </p> |
| <p> |
| <a href="../concepts/concepts-3.htm">Java projects</a><br> |
| <a href="../concepts/cjavaviews.htm">Java views</a><br> |
| </p> |
| <p> |
| <img src="../images/ngrelr.png" alt="Related reference"> |
| </p> |
| <p> |
| <a href="../reference/ref-121.htm">New Java Project Wizard</a><br> |
| <a href="../reference/ref-view-package-explorer.htm">Package Explorer View</a><br> |
| </p> |
| |
| </body> |
| </html> |
| |