CIT 594 Packages in the Parser Assignment
Spring 2008, David Matuszek


Your Tree classes should be in a package named tree. That means, they are in a folder (directory) named tree, and begin with the line:
          package tree;

Your Parser needs to be able to find them, so each class that uses trees should contain the line:
          import tree.Tree;

To turn in your Parser project, combine the directory containing the Tree project and the directory containing the Parser project into a single zip file.


In the Package Explorer pane, select the Tree project. Then choose New Java Package from the File -> New... menu or from the corresponding icon. Name the new package tree.

Drag your classes from the (default package) to the tree package.

In the Package Explorer pane, select the Parser project. Choose Project -> Properties -> Projects, click Add, check the Tree project, then click OK, OK.

Click on a red x in the Parser and select Import 'Tree' (tree).


Netbeans already puts every project into a package, so that part is done.

Next, right click on your Tree project and select Build; This creates a tree.jar file in your Tree project in the dist folder. 

Next, expand your Parser project, right click on Libraries, and select Add Jar/Folder.  Navigate to your tree.jar file and open it.

Finally, use the import tree.Tree; statement in the Parser class.