| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
| "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
| <html lang="en" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> | |
| <head> | |
| <meta name="copyright" content= | |
| "Copyright (c) IBM Corporation and others 2000, 2011. 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=utf-8" /> | |
| <meta http-equiv="Content-Style-Type" content="text/css" /> | |
| <title> | |
| Organizing sources | |
| </title> | |
| <script language="JavaScript" type="text/javascript" src= | |
| "PLUGINS_ROOT/org.eclipse.help/livehelp.js"> | |
| </script> | |
| </head> | |
| <body> | |
| <h1> | |
| Organizing sources | |
| </h1> | |
| <h3> | |
| Layout on file system | |
| </h3> | |
| <ul> | |
| <li>In this section, you will create a new Java project and organize your | |
| sources in separate folders. This will prepare you for handling more | |
| complex layouts. | |
| </li> | |
| <li>Let's assume you want to put your sources in one folder and your | |
| tests in another folder: | |
| <p> | |
| <img src="images/qs-OrganizeSources1.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.svg" 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.svg" alt= | |
| "Opens the 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 "MyProject" 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> and edit | |
| <strong>Configure default...</strong> to modify <strong>Source folder | |
| name</strong> from "src" to "sources". | |
| </p> | |
| <p> | |
| <img src="images/qs-OrganizeSources2.png" alt= | |
| "Build Path Preferences page" /> | |
| </p> | |
| </li> | |
| <li>Click <strong>OK</strong> to return on New Java Project wizard and | |
| then click <strong>Next</strong>. | |
| <p> | |
| <img src="images/qs-OrganizeSources3.png" alt= | |
| "Java Project Source setup" /> | |
| </p> | |
| </li> | |
| <li> | |
| <p> | |
| To add another source folder to your project, click <strong>Create | |
| new source folder</strong> link in <strong>Details</strong> pane or | |
| button <img src="images/packagefolder_obj.svg" alt= | |
| "Create a new Source Folder for the Project" /> in view bar. | |
| </p> | |
| </li> | |
| <li> | |
| <p> | |
| In <strong>New Source Folder</strong> dialog, type "tests" in the | |
| <strong>Folder name</strong> field. | |
| </p> | |
| <p> | |
| <img src="images/qs-OrganizeSources4.png" alt= | |
| "New Source Folder dialog" /> | |
| </p> | |
| </li> | |
| <li>Click <strong>Finish</strong> to validate and close the dialog. | |
| </li> | |
| <li> | |
| <p> | |
| Your project setup now looks as follows: | |
| </p> | |
| <p> | |
| <img src="images/qs-OrganizeSources5.png" alt= | |
| "Java Project Sources final setup" /> | |
| </p> | |
| </li> | |
| <li>Click <strong>Finish</strong> | |
| </li> | |
| <li>You now have a Java project with two source folders: | |
| <i><code>sources</code></i> and <i><code>tests</code></i>. You can start | |
| adding classes to these folders or you can copy them using drag and drop. | |
| <p> | |
| <img src="images/qs-OrganizeSources6.png" alt= | |
| "Created Java project in Workspace" /> | |
| </p> | |
| </li> | |
| </ol> | |
| <p class="nav_footer" id="nav_footer"> | |
| Next Section: <a href="qs-WorkingWithExistingLayout1.htm">Sibling | |
| products in a common source tree</a> | |
| </p> | |
| <h3 class="related">Related concepts</h3> | |
| <a href="../concepts/concept-java-project.htm">Java projects</a><br /> | |
| <a href="../concepts/concept-java-views.htm">Java views</a><br /> | |
| <h3 class="related">Related references</h3> | |
| <a href="../reference/ref-wizard-java-project.htm">New Java Project | |
| Wizard</a><br /> | |
| <a href="../reference/views/ref-view-package-explorer.htm">Package | |
| Explorer View</a><br /> | |
| </body> | |
| </html> |