blob: 9365b1f01fd857495595936348b56fdf86fd8d7c [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//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." >
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta name="GENERATOR" content="Mozilla/4.75 [en] (Windows NT 5.0; U) [Netscape]">
<title>
Creating a Java project with source folders
</title>
<link rel="stylesheet" href="../book.css" charset="ISO-8859-1" type="text/css">
<script language="JavaScript" src="PLUGINS_ROOT/org.eclipse.help/livehelp.js"> </script>
</head>
<body>
<h1>
Creating a Java project with source folders
</h1>
For larger projects, create a project with source folders.
<blockquote>
<em>Note: When using source folders, non-Java resources are copied to the output folder by the Java builder.
If you have non-Java resources (documentation, for example) that should not be copied into the output folder,
you can create an ordinary folder and store the resources there. You can also use 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">
<strong>Java &gt; Compiler &gt; Building</strong></a> preference page
to specify a list of resources that will not be automatically copied to the output folder.</em>
</blockquote>
<ol>
<li>
Open the <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">
<strong>New Java Project</strong></a> wizard. (From the main workbench window, click <strong>File</strong> &gt; <strong>New</strong> &gt; <strong>Project...</strong>.
Select <strong>Java Project</strong>, then click <strong>Next</strong>.)
</li>
<li>
In the <strong>Project name</strong> field, type a name for your new Java project.
</li>
<li>
Select a location for the project and configure the JDK Compliance.
</li>
<li>
In the <strong>Project layout</strong> section, make sure
<strong>Create separate source and output folders</strong> is selected.
</li>
<li>
Click <strong>Next</strong>. The Java Settings Page opens.
</li>
<li>
On the <strong>Source</strong> tab, check that the project contains a source folder. You can create additional source folders at any time
later.
</li>
<li>
Optionally, replace the default name in the&nbsp;<strong><strong>Default output folder</strong></strong> field to use a different name for the output folder.
</li>
<li>
On the <strong>Projects</strong> tab, select the required projects to be on the build path for this project.
</li>
<li>
On the <strong>Libraries</strong> tab, select JAR files and CLASS file containers to add to the build path for this new project and attach source to the JAR files.
</li>
<li>
On the <strong>Order and Export</strong> tab, use the <strong>Up</strong> and <strong>Down</strong> buttons to move the
selected JAR file or CLASS file container up or down in the build path order for this new project.
</li>
<li>
Click&nbsp;<strong>Finish</strong> when you are done.
</li>
</ol>
<blockquote>
<em>Note: When you are using CVS as your repository, it is recommended that you create a .cvsignore file inside the project. In this file, add a line with the name of the
output folder (&quot;bin&quot; for example). Adding the output folder in the .cvsignore file ensures that the CVS versioning support ignores the output folder in versioning
operations.</em>
</blockquote>
<p>
<img src="../images/ngrelc.png" alt="Related concepts" border="0" >
</p>
<p>
<a href="../concepts/concepts-3.htm">Java projects</a><br>
<a href="../concepts/concepts-4.htm">Java builder</a>
</p>
<p>
<img src="../images/ngrelt.png" alt="Related tasks" border="0" >
</p>
<p>
<a href="tasks-11.htm">Creating Java elements</a><br>
<a href="tasks-12.htm">Creating a new Java project</a><br>
<a href="tasks-26.htm">Creating a new source folder</a><br>
<a href="tasks-13.htm">Creating a Java project as its own source container</a><br>
<a href="tasks-15.htm">Creating a new Java package</a><br>
<a href="tasks-17.htm">Creating a new Java class</a><br>
<a href="tasks-149.htm">Creating a Java scrapbook page</a><br>
<a href="tasks-110.htm">Working with build paths</a>
</p>
<p>
<img src="../images/ngrelr.png" alt="Related reference" border="0" >
</p>
<p>
<a href="../reference/ref-121.htm">New Java Project wizard</a>
</p>
</body>
</html>