Instructions: Answer as many of the following questions as you can during the lab period. If you are unable to complete the assignment during the lab period it is strongly recommended that you complete it on your own.
Getting Ready: Before going any further, you should:
JMUview.java
and make sure you understand
it.
JMUview.java
.
TextEditor.class
and
TextWindow.class
into the directory for this lab.
.class
files)?
JMUview.java
.
TextEditor.class
and
TextWindow.class
.
JMUview
.
TextEditor.class
and
TextWindow.class
into the directory for this lab.
JMUview
to make sure it works.
.jar
files.
This part of the lab will help you learn how to create and use
.jar
files.
jar -cvf text.jar TextEditor.class TextWindow.class
TextEditor.class
and TextWindow.class
.
JMUview.class
.
JMUview.java
.
javac -cp text.jar JMUview.java
-cp
option do?
JMUview
.
java -cp text.jar:. JMUview
If you are using MS-Windows,
enter the following command (in a teminal/command window):
java -cp text.jar;. JMUview
:
(in Unix/OS-X) and/or
;
(in MS-Windows) do in the classpath
?
.
do in the classpath
?
classpath
appropriately and compile
JMUview.java
. (For example, in jGRASP you can use
[Settings]+[PATH/CLASSPATH] and choose either workspace or
project. Then, you can create a new classpath
entry
by clicking on [New] and browsing to the .jar
file.)
.jar
files.
This part of the lab will help you learn how to create and use
executable .jar
files.
.class
files and text.jar
.
TextEditor.class
and
TextWindow.class
into the directory for this lab.
JMUview.java
.
JMUview.mft
(called a manifest)
that contains the following:
Manifest-Version: 1.0 Main-Class: JMUview Class-path: .
jar -cvfm JMUview.jar JMUview.mft *.class
-m
option do?
.class
files.
java -jar JMUview.jar
JMUview.jar
(and not some other version) was executed?
.jar
files. Try clicking/double-clicking on
JMUview.jar
to see what happens.
.jar
file for an application you
developed earlier in the semester (either a lab or a
programming assignment).
Copyright 2011