0

So I have two files to compile into jar file: Testfield.class (which i make from Testfield.java via javac command) and manifest.txt.

Now I'm getting this noclassdeffounderror when im running my jar file in cmd it goes as follows:

Exception in thread "main" java.lang.noclassdeffounderror: Testfield (wrong name: testfield/Testfield)

What's the deal ?

edit* Testfield.class file contains the following line:

Main-Class: Testfield
Mofi
  • 46,139
  • 17
  • 80
  • 143

1 Answers1

0

The NoClassDefFoundError indicates that the classloader (in this case java.net.URLClassLoader), which is responsible for dynamically loading classes, cannot find the .class file for the class that you're trying to use can you post your manifest?

You can also try to run javac in -verbose

Balint
  • 295
  • 2
  • 11