{"id":5795,"date":"2014-04-07T09:13:09","date_gmt":"2014-04-07T09:13:09","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/04\/07\/how-does-javac-locate-the-java-api-classes-collection-of-common-programming-errors\/"},"modified":"2014-04-07T09:13:09","modified_gmt":"2014-04-07T09:13:09","slug":"how-does-javac-locate-the-java-api-classes-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/04\/07\/how-does-javac-locate-the-java-api-classes-collection-of-common-programming-errors\/","title":{"rendered":"How does javac locate the Java API classes?-Collection of common programming errors"},"content":{"rendered":"<p>The information on this page provides some good hints and general information, but nothing conclusive.<\/p>\n<p>I know that javac.exe basically just launches &#8216;sun.tools.javac.Main&#8217; from &#8216;tools.jar&#8217; using Java. I also know that the Java API classes are stored in &#8216;rt.jar&#8217; in &#8216;jre\/lib&#8217; under the JDK. Is this where &#8216;javac.exe&#8217; loads the Java API classes from?<\/p>\n<p>I&#8217;m wondering about this scenario in particular: suppose I installed jdk1.6.0_17, and later on I installed jdk1.6.0_25. If I run &#8216;javac.exe&#8217; from jdk1.6.0_17, will it load the Java API classes from &#8216;rt.jar&#8217; in 1.6.0_17 or 1.6.0_25?<\/p>\n<p>The reason I want to know all of this is I&#8217;m in a situation where I know the code I&#8217;m compiling is going to run on a particular (not most recent) version of Java, and I want to compile using the same exact version of javac and the Java API to ensure compatibility.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The information on this page provides some good hints and general information, but nothing conclusive. I know that javac.exe basically just launches &#8216;sun.tools.javac.Main&#8217; from &#8216;tools.jar&#8217; using Java. I also know that the Java API classes are stored in &#8216;rt.jar&#8217; in &#8216;jre\/lib&#8217; under the JDK. Is this where &#8216;javac.exe&#8217; loads the Java API classes from? I&#8217;m [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5795","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5795","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=5795"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5795\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=5795"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=5795"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=5795"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}