<div dir="ltr"><font size="2"><span style="font-family:arial,helvetica,sans-serif"><div style="font-family:arial,helvetica,sans-serif;font-size:large;display:inline" class="gmail_default">​​</div><div style="font-family:arial,helvetica,sans-serif;font-size:large;display:inline" class="gmail_default">​Hello,<br><br>old java programs compile and run fine on newer java versions. You just need to use the right javac options (ie. <span style="font-family:monospace,monospace">-source</span> and <span style="font-family:monospace,monospace">-bootclasspath</span>) if you want to recompile old code with a newer compiler.<br><br>For instance, if you have a java 6 source code that you want to compile with java 8, call javac as below :<br><br><span style="font-family:monospace,monospace">$ javac -source 1.6 -bootclasspath /path/to/java6/rt.jar /path/to/foo.java</span><br><br>Furthermore, to preserve compatibility with older java runtimes, ​the ​option <span style="font-family:monospace,monospace">-target​</span> must be used with -source and -bootclasspath.<br><br>For instance, if you have a java 6 source code that you want to compile with java 8 and want it to be compatible with the JVM 6, 7 and 8, then, call javac as below :<br><br><span style="font-family:monospace,monospace">$ javac -target 1.6 -source 1.6 -bootclasspath /path/to/java6/rt.jar /path/to/foo.java</span><br><br>-- <br>SeB<br><br><font size="2"><span style="font-family:arial,helvetica,sans-serif"></span></font></div></span></font><div class="gmail_extra"><font size="2"><br></font><div class="gmail_quote"><font size="2">2017-06-23 13:47 GMT+02:00 Jim Diamond <span dir="ltr"><<a href="mailto:Jim.Diamond@acadiau.ca" target="_blank">Jim.Diamond@acadiau.ca</a>></span>:<br></font><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><font size="2">On Fri, Jun 23, 2017 at 01:18 (-0400), B Watson wrote:<br></font>
<font size="2"><br>
> What I don't know (since I haven't paid attention to Java in 10+ years)<br>
> is whether future versions of jdk/openjdk will always be compatible<br>
> with code written for older versions (source code and/or compiled<br>
> classes/jars). Will we get stuck having to still have openjdk version<br>
> 7 in 10 years, because some piece of software written in Java can't be<br>
> compiled or run with openjdk 8 and up?<br></font>
<font size="2"><br>
While I make every effort to avoid Java, there is one program I use<br>
written in Java which I haven't yet managed to expunge from my life.<br>
And every time there is a new version of Java out, I have to spend a<br>
couple of days trying to figure out how to do something in the new<br>
version, because the old version has deprecated methods or some<br>
methods now don't do quite what they used to, or I'm no longer allowed<br>
to call that method in that context, or ...<br></font>
<font size="2"><br>
My point is, I doubt I'm the only one who has this issue.  I suppose<br>
the difference is that most people maintaining Java programs do Java<br>
programming 24/7/365, and so they can amortize this "learn the new<br>
correct one and only way to do it" time over lots more code than I<br>
can.<br></font>
<font size="2"><br>
Meanwhile, my 35-year old C programs happily compile and run with no<br>
whining whatsoever.<br></font>
<font size="2"><br>
Cheers.<br>
                                Jim<br>
______________________________</font><font size="2"><wbr>_________________<br>
SlackBuilds-users mailing list<br></font>
<font size="2"><a href="mailto:SlackBuilds-users@slackbuilds.org" target="_blank">SlackBuilds-users@slackbuilds.<wbr>org</a><br></font>
<font size="2"><a href="http://lists.slackbuilds.org/mailman/listinfo/slackbuilds-users" rel="noreferrer" target="_blank">http://lists.slackbuilds.org/m<wbr>ailman/listinfo/slackbuilds-us<wbr>ers</a><br>
Archives - <a href="https://lists.slackbuilds.org/pipermail/slackbuilds-users/" rel="noreferrer" target="_blank">https://lists.slackbuilds.org/<wbr>pipermail/slackbuilds-users/</a><br>
FAQ - <a href="https://slackbuilds.org/faq/" rel="noreferrer" target="_blank">https://slackbuilds.org/faq/</a><br></font>
<font size="2"><br></font>
</blockquote></div><font size="2"><br></font></div></div>