| Author |
Message |
rizzix
|
Posted: Tue Jun 28, 2005 8:47 pm Post subject: (No subject) |
|
|
| does ur manifest file include a Main-Class field? |
|
|
|
|
 |
Sponsor Sponsor

|
|
 |
jin
|
Posted: Tue Jun 28, 2005 9:00 pm Post subject: (No subject) |
|
|
Also "java MyProgramName" worked for applet but gave "Exception in thread "main" java.lang.NoClassDefFoundError: Database/class" for application
Database is name of program. is there a way around this. |
|
|
|
|
 |
jin
|
Posted: Tue Jun 28, 2005 9:01 pm Post subject: (No subject) |
|
|
| Ya it did have a main class field |
|
|
|
|
 |
rizzix
|
Posted: Tue Jun 28, 2005 9:07 pm Post subject: (No subject) |
|
|
| post ur manifest... |
|
|
|
|
 |
jin
|
Posted: Tue Jun 28, 2005 9:22 pm Post subject: (No subject) |
|
|
Manifest-Version: 1.0
Created-By: 1.5.0_01 (Sun Microsystems Inc.)
Main-Class: Database.class
Class-Path: F:\Java\Database |
|
|
|
|
 |
rizzix
|
Posted: Tue Jun 28, 2005 11:06 pm Post subject: (No subject) |
|
|
jin wrote: Manifest-Version: 1.0
Created-By: 1.5.0_01 (Sun Microsystems Inc.)
Main-Class: Database.class
Class-Path: F:\Java\Database
it should be just: | code: | Main-Class: Database | assuming ur using the default package.. |
|
|
|
|
 |
jin
|
Posted: Wed Jun 29, 2005 8:33 am Post subject: (No subject) |
|
|
| i made the change and it created the jar but when i try to open it i get error "Could not find Main-Class. Program will exit". |
|
|
|
|
 |
rizzix
|
Posted: Wed Jun 29, 2005 10:21 am Post subject: (No subject) |
|
|
| obviously that assumes Database has the public static void main(String[] args) method.. if it doesn't then it is not the main class. |
|
|
|
|
 |
Sponsor Sponsor

|
|
 |
1of42
|
Posted: Wed Jun 29, 2005 1:22 pm Post subject: (No subject) |
|
|
rizzix wrote: obviously that assumes Database has the public static void main(String[] args) method.. if it doesn't then it is not the main class.
I bet you that's not the problem... I had this one myself, even though it did have the correct method main signature.
The problem I had was that you must have a newline as the last line in the file; if you don't the manifest doesn't work properly. |
|
|
|
|
 |
jin
|
Posted: Fri Jul 01, 2005 11:14 pm Post subject: (No subject) |
|
|
| Database is the main class and also adding the extra line did not help i still got the error |
|
|
|
|
 |
1of42
|
Posted: Fri Jul 01, 2005 11:58 pm Post subject: (No subject) |
|
|
weird. a manifest i used that worked:
| code: | Manifest-Version: 1.2
Created-By: 1.4.2_04 (Sun Microsystems Inc.)
Main-Class: ReWrite
|
|
|
|
|
|
 |
|