 
    
<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Java Archives - Complete, Concrete, Concise</title>
	<atom:link href="https://complete-concrete-concise.com/category/programming/java/feed/" rel="self" type="application/rss+xml" />
	<link>https://complete-concrete-concise.com/category/programming/java/</link>
	<description>Practical Information Without The Bloat</description>
	<lastBuildDate>Wed, 03 Apr 2013 16:38:58 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9</generator>
	<item>
		<title>warning: [options] bootstrap class path not set in conjunction with -source 1.5</title>
		<link>https://complete-concrete-concise.com/programming/java/warning-options-bootstrap-class-path-not-set-in-conjunction-with-source-1-5/</link>
		
		<dc:creator><![CDATA[richardsplanet]]></dc:creator>
		<pubDate>Wed, 03 Apr 2013 16:38:58 +0000</pubDate>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[-source]]></category>
		<category><![CDATA[bootstrap class]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[NetBeans]]></category>
		<category><![CDATA[warning]]></category>
		<guid isPermaLink="false">http://complete-concrete-concise.com/?p=2758</guid>

					<description><![CDATA[<p>When compiling with Java, you may get a warning message similar (or identical to): warning: [options] bootstrap class path not set in conjunction with -source 1.5 This warning is emitted if you are using JDK 7 Build 121 or later (earlier versions of the compiler would not issue a warning). It is warning you that [&#8230;]</p>
<p>The post <a href="https://complete-concrete-concise.com/programming/java/warning-options-bootstrap-class-path-not-set-in-conjunction-with-source-1-5/">warning: [options] bootstrap class path not set in conjunction with -source 1.5</a> appeared first on <a href="https://complete-concrete-concise.com">Complete, Concrete, Concise</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>When compiling with Java, you may get a warning message similar (or identical to):</p>
<pre><code>warning: [options] bootstrap class path not set in conjunction with -source 1.5</code></pre>
<p>This warning is emitted if you are using JDK 7 Build 121 or later (earlier versions of the compiler would not issue a warning).</p>
<p>It is warning you that your Java compiler version and the version of Java you are compiling for are different. For example, you may have version 7 of the compiler installed, but are choosing to compile for Java version 5.0. While the compiler is capable of emitting code for different versions, it needs to use the correct startup libraries (bootstrap) in order to guarantee it will function correctly.</p>
<div class="c1">
<p>In any other language, this would be called &#8220;linking against the correct startup libraries&#8221;, but in Java, it is called &#8220;compiling against bootstrap and extension classes&#8221;.</p>
</div>
<h1>For Users of NetBeans IDE</h1>
<div class="c1">
<p>These instructions are for NetBeans IDE 7.3.</p>
<p>I suspect the instructions are the same for other versions of NetBeans IDE, but I make no guarantee.</p>
</div>
<p>You can correct the warning by ensuring the compiler version and binary version are the same:</p>
<p><strong>1) Right-click</strong> on the project:</p>
<p><img decoding="async" src="//complete-concrete-concise.com/wp-content/uploads/2013/04/warning-bootstrap-class-path-not-set-1.png" alt="" border="0" class="centered"/></p>
<p><strong>2) Select</strong> <u>Properties</u>:</p>
<p><img decoding="async" src="//complete-concrete-concise.com/wp-content/uploads/2013/04/warning-bootstrap-class-path-not-set-2.png" alt="" border="0" class="centered"/></p>
<p><strong>3) Ensure</strong> that the <u>Source/Binary Format:</u> under the <u>Sources</u> category, matches the <u>Java Platform</u> under the <u>Libraries</u> category (click for full sized image):</p>
<p><a href="//complete-concrete-concise.com/wp-content/uploads/2013/04/warning-bootstrap-class-path-not-set-3-big.png" target="_blank"><img decoding="async" src="//complete-concrete-concise.com/wp-content/uploads/2013/04/warning-bootstrap-class-path-not-set-3-thumb.png" alt="" border="0" class="centered"/></a></p>
<h1>For Command Line Users</h1>
<p>If you are compiling using the command line, then you need to ensure that the <code>-source</code> and <code>-target</code> options refer to the same version and the <code>-bootclasspath</code> option refers to the correct Java runtime.</p>
<p>For example, if you have JDK 7 installed and want to compile for Java 5.0, then the command line would be:</p>
<pre><code>javac -source 1.5 -target 1.5 -bootclasspath <u><em>path-to-java-5.0-runtime</em></u> <em>code.java</em></code></pre>
<p>Where <code>path-to-java-5.0-runtime</code> is the path to the <code>rt.jar</code> file of Java 5.0 (note: you have to include <code>rt.jar</code> as part of the path.</p>
<p>Where <code>code.java</code> is Java code compatible with version 5.0.</p>
<div class="c1">
<p>Note: The mapping from Java version to command line attributes are:</p>
<ul>
<li>Java 1.2 => 1.3 (unless there is a typo in the JDK 7 warning, it is 1.3 not 1.2)</li>
<li>Java 1.3 => 1.3</li>
<li>Java 1.4 => 1.4</li>
<li>Java 5.0 => 1.5</li>
<li>Java 6 => 1.6</li>
</ul>
</div>
<p>Normally, you do not have to specify the <code>-target</code> option because by default it is set the same as the <code>-source</code> option.</p>
<h1>For Other IDE Users</h1>
<p>You will have to read (or explore) your IDE to determine where the compiler and target settings are located. It is probably a safe bet that they are part of the project options (try right-clicking on the project name and see if a menu pops up, or see if there is something like a <u>Project Options</u> setting somewhere.</p>
<h1>More Information</h1>
<div class="c1">
<p>These are external links and where deemed to be safe and relevant at the time of publication.</p>
<p>If there are problems with them, please let me know.</p>
</div>
<p><a href="http://docs.oracle.com/javase/7/docs/technotes/tools/solaris/javac.html">javac &#8211; Java programming language compiler</a> &#8211; search for <code>bootclasspath</code> on the page</p>
<p><a href="http://www.oracle.com/technetwork/java/javase/compatibility-417013.html">Java SE 7 and JDK 7 Compatibility</a> &#8211; a discussion about Java 7 compatibility with previous versions</p>

<p>The post <a href="https://complete-concrete-concise.com/programming/java/warning-options-bootstrap-class-path-not-set-in-conjunction-with-source-1-5/">warning: [options] bootstrap class path not set in conjunction with -source 1.5</a> appeared first on <a href="https://complete-concrete-concise.com">Complete, Concrete, Concise</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
