• Post Reply Bookmark Topic Watch Topic
  • New Topic

JAR problem: ClassNotFoundException  RSS feed

 
G Svensson
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I use Eclipse with the plugin "FatJar" see attachemnt for screenshot

This has been working like a charm for several months but now suddenly I get:
Exception in thread "main" java.lang.NoClassDefFoundError: GcDiskUsage

I am not sure what I changed to get this error so I have tried to manage it by hand with:
http://java.sun.com/docs/books/tutorial/deployment/jar/downman.html

But no luck I afraid.
JnlpGivesClassNotFound_01.jpg
[Thumbnail for JnlpGivesClassNotFound_01.jpg]
 
Rob Spoor
Sheriff
Posts: 21133
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did a search for the class name but there is nothing on Google. Also, there is no package there. Are you sure it's not your own class?

Also, I'm moving this to the general forum.
 
G Svensson
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob Prime wrote:I did a search for the class name but there is nothing on Google. Also, there is no package there. Are you sure it's not your own class?


GcDiskUsage is my project indeed.

the command:
jar tvf GcDiskUsage_unsigned.jar

...gives me:
 
Rob Spoor
Sheriff
Posts: 21133
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The class name is incorrect. The JVM tries to find class GcDiskUsage, but the real name is gc.GcDiskUsage.
 
G Svensson
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob Prime wrote:The class name is incorrect. The JVM tries to find class GcDiskUsage, but the real name is gc.GcDiskUsage.


Oh my... I just found out by experimenting with FatJar. See the screenshot again. I forgot to set the Class.
Sorry for taking your time with this. eehrmmm
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!