aspose file tools*
The moose likes Beginning Java and the fly likes Jar doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Jar doubt" Watch "Jar doubt" New topic
Author

Jar doubt

pras
Ranch Hand

Joined: Apr 04, 2007
Posts: 188
1>suppose i wrote a program called HelloUsa.java which is in package ab
2>now the HelloUsa.class files ie i created a jar file called prasanna.jar
3>now i put the(my prasanna.jar) jar file in .../jre/lib/ext
4>Actually my program HelloUsa.java should run when i execute java HelloUsa even if there is no .class files in my current dir for where i compile

is it right??
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19696
    
  20

Not quite.

Because the class is in a package, the .class file should be in a folder called ab in the JAR file, and you should call the app using "java ab.HelloUSA". You are 100% correct about not needing to specify a classpath because the JAR file is in the /jre/lib/ext folder.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Jar doubt