L
Leonard Slatkin
I'm taking my first Java course, and we're using the NetBeans IDE.
I'm trying to use .JAR files:
For example, I have a package (all in a folder with the same name) that
compiles and executes fine. I make a JAR out of it using NetBeans, and
mount TestJar.jar with File> Mount Filesystem> Archive files.
The package seems to mount just fine: I can open the source files I
included (they are read-only), and all the .class files are there, but
when I try to execute the main class
FireSupport/MyMainClass.java [0:0] No file named
FireSupport/MyMainClass.java exists on disk in TestJar.jar.
Therefore it may not be compiled with an external compiler.
You may need to check it out from version control or save some changes
to it.
Errors compiling MyMainClass.
What am I doing wrong?
Thanks for any help!
This is how I make the JAR file:
File> New > JAR Archives > JAR Recipe and:
enter TestJar as the name,
select All Files in the Recipe Filter,
and ADD the folder that contains all my files in the package
I click "Generate" on the JAR Manifest page, add the line:
Main-Class: MyMainClassName
and click Finish.
Then, I right-click on the new TestJar file in the Explorer
[Filesystems], and choose Compile.
A file called TestJar.jar is created, and if I unzip it, everything
looks okay inside.
I'm trying to use .JAR files:
For example, I have a package (all in a folder with the same name) that
compiles and executes fine. I make a JAR out of it using NetBeans, and
mount TestJar.jar with File> Mount Filesystem> Archive files.
The package seems to mount just fine: I can open the source files I
included (they are read-only), and all the .class files are there, but
when I try to execute the main class
FireSupport/MyMainClass.java [0:0] No file named
FireSupport/MyMainClass.java exists on disk in TestJar.jar.
Therefore it may not be compiled with an external compiler.
You may need to check it out from version control or save some changes
to it.
Errors compiling MyMainClass.
What am I doing wrong?
Thanks for any help!
This is how I make the JAR file:
File> New > JAR Archives > JAR Recipe and:
enter TestJar as the name,
select All Files in the Recipe Filter,
and ADD the folder that contains all my files in the package
I click "Generate" on the JAR Manifest page, add the line:
Main-Class: MyMainClassName
and click Finish.
Then, I right-click on the new TestJar file in the Explorer
[Filesystems], and choose Compile.
A file called TestJar.jar is created, and if I unzip it, everything
looks okay inside.