aspose file tools*
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 Java 8 in Action this week in the Java 8 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
Author

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

kirba devi
Ranch Hand

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

Joined: Jun 29, 2007
Posts: 50
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
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
mysql connector classpath problem on unix
Connection problem with MYSQL
jar runs on desktop but not laptop