blob: 10edba629944c99e3a2c226dc5af23e41a2e6148 [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>
Adding source code as individual files
</title>
<link rel="stylesheet" href="../book.css" charset="ISO-8859-1" type="text/css">
</head>
<body>
<h1>
Adding source code as individual files
</h1>
<h2>
From a ZIP or JAR file
</h2>
<ol>
<li>
In the Navigator or Package Explorer, you can optionally select the source folder into which you wish to import the source. <em>Note: It is important to choose a source
container; otherwise, the imported files will not be on the build path.</em>
</li>
<li>
From the workbench menu bar, select <strong>File</strong> &gt; <strong>Import</strong>.
</li>
<li>
In the Import wizard, select <strong>Zip file</strong>, then click&nbsp;<strong>Next</strong>.
</li>
<li>
In the&nbsp;<strong>Zip file</strong> field, type or browse to select the file from which you would like to add the resources. In the import selection
panes, use the following methods to select exactly the resources you want to add:
<ul>
<li>
Expand the hierarchies in the left pane and check or clear the boxes representing the containers in the selected directory. Then in the right pane, select or clear
boxes for individual files.
</li>
<li>
Click <strong>Select Types</strong> to select specific file types to add.
</li>
<li>
Click <strong>Select All</strong> to select all files in the directory, then go through and deselect the ones that you don't want to add.
</li>
<li>
Click <strong>Deselect All</strong> to deselect all files in the directory, then go through and choose individual files to add.
</li>
</ul>
</li>
<li>
In the <strong>Select the destination for imported resources</strong> field, type or browse to select a workbench container for the added resources (if it was not
already selected when you activated the&nbsp;<strong>Import</strong> command).
</li>
<li>
In the <strong>Options</strong> area, you can choose whether or not to overwrite existing resources without warning.
</li>
<li>
Click <strong>Finish</strong> when you are done.
</li>
</ol>
<h2>
From a directory
</h2>
<ol>
<li>
In the Navigator or Package Explorer, select the source folder into which you wish to import the source. <em>Note: It is important to choose a source container; otherwise,
the imported files will not be on the build path.</em>
</li>
<li>
From the workbench menu bar, select <strong>File</strong> &gt; <strong>Import</strong>.
</li>
<li>
In the import wizard, select <strong>File System</strong>, then click&nbsp;<strong>Next</strong>.
</li>
<li>
In the <strong>Directory</strong> field, type or browse to select the directories from which you would like to add the resources.
</li>
<li>
In the import selection panes, use the following methods to select exactly the resources you want to add:
<ul>
<li>
Expand the hierarchies in the left pane and check or clear the boxes representing the containers in the selected directory. Then in the right pane, select or clear
boxes for individual files.
</li>
<li>
Click&nbsp;<strong>Select Types</strong> to select specific file types to add.
</li>
<li>
Click&nbsp;<strong>Select All</strong> to select all files in the directory, then go through and deselect the ones that you don't want to add.
</li>
<li>
Click&nbsp;<strong>Deselect All</strong> to deselect all files in the directory, then go through and choose individual files to add.
</li>
</ul>
</li>
<li>
In the <strong>Select the destination for imported resources</strong> field, type or browse to select a workbench container for the added resources (if
it was not already selected when you activated the&nbsp;<strong>Import</strong> command).
</li>
<li>
In the <strong>Options</strong> area, you can choose whether you want to:
</li>
<ul>
<li>
overwrite existing resources without warning
</li>
<li>
create a complete file structure for the imported files
</li>
</ul>
<li>
Click&nbsp;<strong>Finish</strong> when you are done.
</li>
</ol>
<p>
<img src="../images/ngrelc.png" alt="Related concepts" border="0" >
</p>
<p>
<a href="../concepts/concepts-1.htm">Java development tools (JDT)</a> <br>
<a href="../concepts/cbuildcp.htm">Build classpath</a> </p>
<p>
<img src="../images/ngrelt.png" alt="Related tasks" border="0" >
</p>
<p>
<a href="tasks-30.htm">Adding a JAR file as a library</a>
</p>
<p>
<img src="../images/ngrelr.png" alt="Related reference" border="0" >
</p>
<p>
<a href="../reference/ref-123.htm">Java Build Path</a><br>
<a href="../reference/ref-view-package-explorer.htm">Package Explorer</a>
</p>
</body>
</html>