blob: 6b2629570206e62e025a05075e88cfaf5e2b8e43 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
<head>
<title>
Products sharing a common source framework
</title>
<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">
</head>
<body>
<h1>
Products sharing a common source framework
</h1>
<p>The Java source files for two products require a common framework:
</p>
<p><img src="../images/qs-WorkingWithExistingLayout4.gif" width=457 height=316 alt="Layout 4">
</p>
<ol>
<li>Select the menu item <strong>File &gt; New &gt; Project...</strong>. to open the <strong>New Project</strong> wizard.
</li>
<li>
On the left pane of the first wizard page, select <strong>Java</strong>, and on the right pane, select <strong>Java Project</strong>.
Click <strong>Next</strong>.
</li>
<li>On the next page, type &quot;Product1&quot; in the <strong>Project name</strong> field. Click <strong>Next</strong>.
<p><img src="../images/qs-WorkingWithExistingLayout41.gif" width=500 height=507 alt="Source and output folders page"></p>
</li>
<li>
Select &quot;Product1&quot; source folder and click <strong>Edit...</strong>.
</li>
<li>
Click <strong>Create New Folder...</strong>. Type &quot;JavaSourceFiles&quot; in the <strong>Folder name</strong> field.
</li>
<li>
Click <strong>Advanced</strong>. Check <strong>Link to folder in the file system</strong>.
Click <strong>Browse....</strong> and choose the &quot;JavaSourceFiles&quot; directory in &quot;Product1&quot;.
<p><img src="../images/qs-WorkingWithExistingLayout42.gif" width=416 height=248 alt="Source and output page after setting output"></p>
</li>
<li>Click <strong>OK</strong> twice to close the two dialogs.
</li>
<li>
Click <strong>Add Folder...</strong>.
</li>
<li>
Click <strong>Create New Folder...</strong>. Type &quot;src-common&quot; in the <strong>Folder name</strong> field.
</li>
<li>
Click <strong>Advanced</strong>. Check <strong>Link to folder in the file system</strong>.
Click <strong>Browse....</strong> and choose the &quot;JavaSourceFiles&quot; directory in &quot;CommonFramework&quot;.
<p><img src="../images/qs-WorkingWithExistingLayout43.gif" width=416 height=248 alt="Source and output page after setting output"></p>
</li>
<li>Click <strong>OK</strong> twice to close the two dialogs.
</li>
<li>
Type &quot;Product1/bin&quot; in the <strong>Default output folder</strong> field.
<p><img src="../images/qs-WorkingWithExistingLayout44.gif" width=500 height=507 alt="Source and output page after setting output"></p>
</li>
<li>Click <strong>Finish</strong>.
</li>
<li>Repeat these steps for &quot;Product2&quot;.
</li>
<li>
You now have two Java projects which respectively contain the sources of &quot;Product1&quot; and &quot;Product2&quot;
and which are using the sources of &quot;CommonFramework&quot;.
<p><img src="../images/qs-WorkingWithExistingLayout45.gif" width=558 height=454 alt="Java perspective"></p>
</li>
</ol>
<em>Note: </em>Files in &quot;src-common&quot; are shared. So editing &quot;Common.java&quot; in &quot;Product1&quot;
will modify &quot;Common.java&quot; in &quot;Product2&quot;. However they are compiled in the context of their
respective projects. Two &quot;Common.class&quot; files will be generated; one for each project. If the two projects have
different compiler options, then different errors could be reported on each &quot;Common.java&quot; file.
<p>
<img border="0" src="../images/ngrelc.gif" alt="Related concepts" width="159" height="27">
</p>
<p>
<a href="../concepts/concepts-3.htm">Java projects</a><br>
<a href="../tasks/tasks-6.htm">Java views</a><br>
</p>
<p>
<img src="../images/ngrelt.gif" alt="Related tasks" border="0" height="27" width="159">
</p>
<p>
<a href="../tasks/tasks-110.htm">Working with build paths</a><br>
<a href="../tasks/tasks-12.htm">Creating a new Java project</a><br>
<a href="../tasks/tasks-14.htm">Creating a Java project with source folders</a><br>
<a href="../tasks/tasks-26.htm">Creating a new source folder</a><br>
<a href="../tasks/tasks-45.htm">Using the Package Explorer</a><br>
</p>
<p>
<img src="../images/ngrelr.gif" width=159 height=27 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>
<p>
<a href="../hglegal2003.htm"><img src="../images/ngibmcpy2003.gif" width=324 height=14 alt="Copyright (c) 2000, 2003 IBM Corporation and others. All Rights Reserved." border="0"></a>
</p>
</body>
</html>