This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using ..\jre\lib\ext with jar files

 
kirba devi
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
i am preparing for scjp 5.
when i tried placing jar file(myApp.jar) in ...jre\lib\ext directory.
and then invoking the java class file it is showing java.lang.NoClassDefFoundError error.

Directory structure
myproject
[LIST]
source
[LIST]
com
[LIST]
wickdelysmart
[LIST]
Fruits.java


From source as current directory i created jar file jar cvf myApp.jar .

Regards
Kirba
 
kirba devi
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i added directory structure wrongly

Here goes,
C:\myproject\source\com\wickdelysmart\Fruits.java
C:\myproject\classes\com\wickdelysmart\Fruits.class

From classes folder i created jar file
C:\myproject\classes>jar cvf myApp.jar .

Finally i place myApp.jar in ...jre\lib\ext directory

then open cmd prompt
c:>java com.wickdelysmart.Fruits

Exception in thread "main" java.lang.NoClassDefFoundError: com/wickdelysmart/Fruits


Regards
Kirba
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic