This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

classpath for j2se library

 
saloni jhanwar
Ranch Hand
Posts: 583
Firefox Browser Notepad Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
gurpeet singh
Ranch Hand
Posts: 924
1
Fedora Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
gurpeet singh
Ranch Hand
Posts: 924
1
Fedora Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 583
Firefox Browser Notepad Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 924
1
Fedora Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
welcome
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic