-1

As far as I know, there aren't a lot of differences between JDK 6 and JDK 7. At least, I haven't yet come across a difference (I coded with JDK 7 and with JDK 6).

A lot of computers run JRE 6 or JRE 7. Compiling my program using JDK 7 will narrow the number of potential computers that can run my application.

Is it generally a good idea to always program using JDK 6 and compile my program for JRE 6? Is this something common? Or is it generally a bad idea?

Aviv Cohn
  • 21,190
  • 31
  • 118
  • 178
  • @gnat It's not a duplicate, my question is similar but focuses on a different issue. – Aviv Cohn Mar 04 '14 at 13:48
  • 3
    @Prog It may or may not be a duplicate, but [the accepted answer](http://programmers.stackexchange.com/a/205018/104843) on that question does give you a very valid reason to not use 6 anymore. – mrjink Mar 04 '14 at 14:01
  • @mrjink But there's still the big downside, of narrowing the amount of computers that can use my application if I compile it for JRE 7. Lot's of computers still run JRE 6. – Aviv Cohn Mar 04 '14 at 14:05
  • 2
    "lots of computers" [is a matter of opinion](http://meta.programmers.stackexchange.com/questions/6483/why-was-my-question-closed-or-down-voted/6491#6491) (how many computers make "lots" and when it's not too much) while support for security fixes and other consequences involved in Java 6 End Of Life are hard, technical, authoritatively addressible concerns – gnat Mar 04 '14 at 14:12
  • @Prog Everyone that uses the default JRE package will have auto-update shout at them that they need to update. And there's no need for you to suppport EOL software. Better still, your application might be a good reason for them to update, and you'll have saved a poor soul. – mrjink Mar 04 '14 at 14:13
  • @Prog where are your statistics on how many computers run Java6 vs Java7? – Ampt Mar 04 '14 at 15:00
  • @Ampt Some of the computers in my school (I'm a twelfth year high school student) run Java 6, and some of my friends and family members still do. – Aviv Cohn Mar 04 '14 at 16:07

2 Answers2

7

It's generally good to use JDK 7 because its still being supported. As this question's answer states, Java 6 is at end of life. This means that security updates are less of a priority if at all and compatibility with newer systems is not an issue that is of particular importance to the maintainers of the JDK.

You may not use many features of Java 7 but that doesn't mean you shouldn't be targeting it for release. The only reason you'd want to target JDK 6 that I can think of is that the deployment environment that you are targeting can't support Java 7.

There's also the small matter of the very near future release of Java 8.

2

Kudos to @WorldEngineer. I do want to add that the decision of whether to support JDK 6 or other backwards compatibility requirements is not usually your decision to make unless you are the CTO or other decision maker at your organization, or this is just a hobby project--so why worry about it? Tell the people that have a stake in the issue what the costs, risks/rewards are and then go with what they tell you.

Backwards compatibility is almost always a business decision: not a dev decision. IMHO, when you have a choice, go with the latest stable standard for whatever technology you are using unless the business tells you otherwise.

I would strongly advise against making this decision on your own and not letting the business owners make it for you. CYA.

Of course, if this is in regards to a hobby project, or you are the CTO etc... I think you should always go with the latest standard.

Jonathan Henson
  • 5,039
  • 3
  • 26
  • 33