Get your CodeRanch badge!*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes classpath for j2se library Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "classpath for j2se library " Watch "classpath for j2se library " New topic
Author

classpath for j2se library

saloni jhanwar
Ranch Hand

Joined: Feb 09, 2012
Posts: 583

Which one is classpath for j2se library ?

C:\Program Files\Java\jdk1.7.0_04\jre\lib\rt.jar
or
C:\Program Files\Java\jdk1.7.0_04\jre\lib\ext


Tell the difficulties that i am difficult.
gurpeet singh
Ranch Hand

Joined: Apr 04, 2012
Posts: 923
    
    1

First of all i would like to point out that it is not J2SE anymore. it is java se 6, 7. they have dropped the 2 long ago. now coming to your question i'm not sure but if you are looking for path to standard java classes then it would be the first one i.e. c:\program files\java\jdk1.7.0_04\jre\lib\rt.jar.

also when javac or java searches for classes they automatically search for the standard java classes . that is the reason you don't have to specify path of standard java classes while compiling/running your application.

the second path you gave viz c:\program files\java\jdk1.7.0_04\jre\lib\ext is related to classpath and development in that it is the java extension mechanism. this path will also will be searched for ANY JAR's , mind it this is important only jar file( no class file , no source file) while searching for classes. this means that if you have some jar file you can directly copy it here and it will be automatically be searched. for more details there is excellent article on oracle tutorail site regarding bootstrapped classes and java extension mechanism.


OCPJP 6(100 %) OCEWCD 6(91 %) OCPJBCD(93%)
gurpeet singh
Ranch Hand

Joined: Apr 04, 2012
Posts: 923
    
    1

also you might want to look at the following article given at ibm i was talking about. this is the best article out of numerous articles i have read on internet regarding classpath and development. i highly recommend you atleast go through it. please find the article at http://www.ibm.com/developerworks/java/library/j-classpath-windows/
saloni jhanwar
Ranch Hand

Joined: Feb 09, 2012
Posts: 583

gurpeet singh wrote:also you might want to look at the following article given at ibm i was talking about. this is the best article out of numerous articles i have read on internet regarding classpath and development. i highly recommend you atleast go through it. please find the article at http://www.ibm.com/developerworks/java/library/j-classpath-windows/


Thanks, that was good link.
gurpeet singh
Ranch Hand

Joined: Apr 04, 2012
Posts: 923
    
    1

welcome
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: classpath for j2se library
 
Similar Threads
JRE Question
Problem with the first example of HFSJ
javax.sound.midi compatibility with JMF
Where to put jar files
JDBC driver - java lang ClassNotFoundException