NoClassDefFoundError

M

Monsieur Le Maire

I have this error when I try to run a program, it can't
find the main class, although I created all the necessary
files.

I have
ApplicationFrction.java
Fraction.Java
read_int.java

all the java program start with a package fraction. I run java but
always get NoClassDefFoundError it can't find the main class. I
played with CLASSPATH variable, I called the mainclass
fraction.ApplicationFraction

Could it be there's a conflict between the package fraction and the
class fraction ...


batch file:
C:\j2sdk1.4.2\bin\javac.exe *.java

C:\j2sdk1.4.2\bin\jar cf tp2.jar *.class

C:\j2sdk1.4.2\bin\jar cmf mainclass tp2.jar *.class

C:\j2sdk1.4.2\bin\java -jar tp2.jar

C:\j2sdk1.4.2\bin\jar tvf tp2.jar

main class file

Main-Class: fraction/ApplicationFraction
 
G

ghl

Monsieur Le Maire said:
I have this error when I try to run a program, it can't
find the main class, although I created all the necessary
files.

I have
ApplicationFrction.java
Fraction.Java
read_int.java

all the java program start with a package fraction. I run java but
always get NoClassDefFoundError it can't find the main class. I
played with CLASSPATH variable, I called the mainclass
fraction.ApplicationFraction
See: http://jinx.swiki.net/61 for information on proper classpath to the jar
file, making the jar file double-clickable, and other package/classpath
usage.
I believe your manifest file has bad format for the Main-Class: entry.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top