[Slackbuilds-users] possible submission
Sebastien BALLET
slacker6896 at gmail.com
Fri Jun 23 15:42:40 UTC 2017
Hello,
old java programs compile and run fine on newer java versions. You just
need to use the right javac options (ie. -source and -bootclasspath) if you
want to recompile old code with a newer compiler.
For instance, if you have a java 6 source code that you want to compile
with java 8, call javac as below :
$ javac -source 1.6 -bootclasspath /path/to/java6/rt.jar /path/to/foo.java
Furthermore, to preserve compatibility with older java runtimes, the
option -target must be used with -source and -bootclasspath.
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 :
$ javac -target 1.6 -source 1.6 -bootclasspath /path/to/java6/rt.jar
/path/to/foo.java
--
SeB
2017-06-23 13:47 GMT+02:00 Jim Diamond <Jim.Diamond at acadiau.ca>:
> On Fri, Jun 23, 2017 at 01:18 (-0400), B Watson wrote:
>
> > What I don't know (since I haven't paid attention to Java in 10+ years)
> > is whether future versions of jdk/openjdk will always be compatible
> > with code written for older versions (source code and/or compiled
> > classes/jars). Will we get stuck having to still have openjdk version
> > 7 in 10 years, because some piece of software written in Java can't be
> > compiled or run with openjdk 8 and up?
>
> While I make every effort to avoid Java, there is one program I use
> written in Java which I haven't yet managed to expunge from my life.
> And every time there is a new version of Java out, I have to spend a
> couple of days trying to figure out how to do something in the new
> version, because the old version has deprecated methods or some
> methods now don't do quite what they used to, or I'm no longer allowed
> to call that method in that context, or ...
>
> My point is, I doubt I'm the only one who has this issue. I suppose
> the difference is that most people maintaining Java programs do Java
> programming 24/7/365, and so they can amortize this "learn the new
> correct one and only way to do it" time over lots more code than I
> can.
>
> Meanwhile, my 35-year old C programs happily compile and run with no
> whining whatsoever.
>
> Cheers.
> Jim
> _______________________________________________
> SlackBuilds-users mailing list
> SlackBuilds-users at slackbuilds.org
> http://lists.slackbuilds.org/mailman/listinfo/slackbuilds-users
> Archives - https://lists.slackbuilds.org/pipermail/slackbuilds-users/
> FAQ - https://slackbuilds.org/faq/
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.slackbuilds.org/pipermail/slackbuilds-users/attachments/20170623/15aac674/attachment.html>
More information about the SlackBuilds-users
mailing list