Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

could not find the main class

843810Mar 4 2003 — edited Mar 14 2003
I have just finished my program. All waht | was doing in the 2 weeks before is only to make an executable jar file for my program. Beacuse I should submit it to my advisor in the university as early as possible.

But I will get crazy...because of this message "Could not find the main class".
I searched the forum for a solution. And I tried all the suggestions but, no way.

This is the way I get used to follow in making a Jar file:

I want to mention that my program is packaaged.
package name is AnalystSystem
Main class is AnalysisClass

1- I make a text file called mainClass.txt including the following

Manifest-Version: 1.0
Main-Class: AnalystSystem.AnalysisClass
Created-By: 1.4.0_01 (Sun Microsystems Inc.)

2- I save the text file and also the package that
contain my program classes to the bin folder.

3- I write this command:
C:\jdk1.4\bin\jar cmf mainClass.txt jarfile.jar AnalystSystem

Some of the suggestions from the forum I tried:
1-to ensure that only the main class that has a main method.
2-to make a new package
3-to run the jar file in another driver, operating system or computer.

Also I tired to include all the classes in a one file without using a package.

Any one can help me in this!



Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 11 2003
Added on Mar 4 2003
2 comments
198 views