This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Using ..\jre\lib\ext with jar files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Using ..\jre\lib\ext with jar files" Watch "Using ..\jre\lib\ext with jar files" New topic

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

kirba devi
Ranch Hand

Joined: Jun 29, 2007
Posts: 50
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

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

kirba devi
Ranch Hand

Joined: Jun 29, 2007
Posts: 50
i added directory structure wrongly

Here goes,

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

I agree. Here's the link:
subject: Using ..\jre\lib\ext with jar files
Similar Threads
package,classpath and servlet
mssql jars not being found in common/lib directory on tomcat 5.5 server
Connection problem with MYSQL
jar runs on desktop but not laptop
mysql connector classpath problem on unix