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

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top