In this course you must frequently download collections of files for use in labs and assignments. We're going to use jar, or Java archive, files for this purpose in CSCI 201.
In each lab, you will typicaly be given a link to a Jar archive such as this link to the archive file Tryit.jar. Depress the shift key and right-click on the link, to Save the file to your hard drive. Save the file in your csci/201 folder. Although Netbeans offers jar file extraction capabilities, it is easier to use Sun's jar file extractor. To do so, give the following commands in your Linux session window:
[user@mach dir] cd csci/201 [user@mach dir] jar xfv Tryit.jar created: META-INF/ inflated: META-INF/MANIFEST.MF created: Tryit/ inflated: Tryit/TryIt.java
In the first command, cd csci/201, we are setting our current working directory to be csci/201, the directory containing the archive file Tryit.jar. The command jar xfv Tryit.jar unpacks or "expands" the archive file.
Give the command ls -R (dir in windows) to see the directory (and its contents) created by unpacking the archive file.
[user@mach dir] ls -R
To see the contents of the java file that you just downloaded, you need to open it in Netbeans:
[user@mach dir] netbeans &
There is one more step that is required if the jar file contains an applet. Keep in mind that TryIt is not an applet; this information is being provided for future reference only. In order to compile and run an applet correctly, you will need to tell Netbeans that it is an applet. To do this: