Java Reference
In-Depth Information
16.
At the Export window, click the Finish button.
17.
Using My Computer verify a folder called MyFirstProject is on the F drive and that the
.class and .java files are in the correct subfolders per Figure A-27 .
18.
Now the easy part, select NewProject in the Package Explore, click File then Import.
19.
Specify File System as the source and click the Next button.
20.
Specify F:\MyFirstProject as the From directory, then in the tree click the MyFirstProject's
checkbox and then click Finish.
21.
At the Question window, click the Yes To All button.
Looking in NewProject should show that the myFirstPackage folder and its contents were imported. You can
confirm that the import was successful by running EmployeeApp.
The “problem” with exporting the entire project is that structure the holds the package with the .class files is more
complicated than the Tutorial example (which simply exported the package). This means that the classpath value has
to be changed to point to this new location rather than the F: drive. If you are using the bat file, it must be modified to
issue the correct set classpath command.
Results of the Tutorial
Let's check the results:
1.
A new Java project called NewProject.
2.
NewProject\src\myFirstPackage and F:\MyFirstProject\src\myFirstPackage each
have two source files.
3.
F:\myFirstPackage and F:\MyFirstProject\bin\myFirstPackage each have two
bytecode files.
4.
The JRE successfully installed and the Employee_Application.bat file created on
the F: drive.
5.
Two printouts of the commands in the Employee_Application.bat file.
Review Questions
1.
What is the function of the JVM?
2.
Which are executable: java files, class files, or both?
3.
What does a batch file hold?
4.
What is the classpath?
5.
What is exporting?
6.
What is the relationship between source code, machine language, and bytecode?
 
Search WWH ::




Custom Search