| <!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 > New > 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 "Product1" 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 "Product1" source folder and click <strong>Edit...</strong>. |
| </li> |
| <li> |
| Click <strong>Create New Folder...</strong>. Type "JavaSourceFiles" 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 "JavaSourceFiles" directory in "Product1". |
| <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 "src-common" 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 "JavaSourceFiles" directory in "CommonFramework". |
| <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 "Product1/bin" 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 "Product2". |
| </li> |
| <li> |
| You now have two Java projects which respectively contain the sources of "Product1" and "Product2" |
| and which are using the sources of "CommonFramework". |
| <p><img src="../images/qs-WorkingWithExistingLayout45.gif" width=558 height=454 alt="Java perspective"></p> |
| </li> |
| </ol> |
| <em>Note: </em>Files in "src-common" are shared. So editing "Common.java" in "Product1" |
| will modify "Common.java" in "Product2". However they are compiled in the context of their |
| respective projects. Two "Common.class" files will be generated; one for each project. If the two projects have |
| different compiler options, then different errors could be reported on each "Common.java" 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> |
| |