Menu

Import and Export Java project in a Zip file in Eclipse

Importing a Java Project from a Zip File into a Workspace

In the past, we have imported projects as JAR files into the src folder of an existing project. For this course, it will probably be easier to import projects directly into the workspace. This is especially true with shader programs since they often require additional text file resources (in our case, shader source code in simple text files) that we didn’t encounter in previous Java programs. When I create demo projects for you, I will often create them for you as zip files.

To import a Java project from a zip file into a workspace:

1. Open Eclipse and navigate to the workspace. To make life easier for us all, make that the workspace that includes your other JOGL projects.
2. Select File…Import…
3. Expand General, select Existing Projects into Workspace and click Next.
4. Click the Select archive file radio button and browse for the zip file containing the project.
5. Click Finish and the project should appear in your workspace. Note: Eclipse will not import a project if you already have one with the same name. If you still want to proceed, rename the existing one and try importing again.

Exporting a Java Project to a Zip File

If you want to export one of your projects to a zip file, do this:

1. Left-click the project name in Package Explorer that you want to export (For example, if the project is named ColorMixer, left-click on that name).
2. Select File…Export…
3. Expand General, select Archive File, and click Next.
4. In the Export dialog, make sure that your selected project is checked and that the options Save in zip format and Create directory structure for files are both selected.
5. Browse for a location to save the archive file. A zip extension will be added automatically.
6. Click Finish and your project should be saved as a zip file in the location you requested.

No comments:

Post a Comment