Java 6 or 7? (Solved)

Hello JGO

I’m building an educational program in Java with secondary school students in focus. To be more precise, a program that explains math to em. When i started to work on this program Java 1.7 had just been released but no eclipse support for it and I don’t like to work in netBeans. But now with the eclipse support I want to make use of java 1.7 stuff like switch statements for strings and the try with resource thingie, my problem is: Will a java 7 written program be of any use for students? Java 6 is installed on pretty much all computers i have seen so far. But i don’t know how well java 1.7 has been welcomed by users, do you guys have any experience in this field? Do people use java 7 yet? if not, when will they start using it or will they skip it to go to java 8 that i have read somewhere will be released 2012?

//Kurten

No you cannot run Java 7 programs on Java 6. However, you can install Java 7 on your computer and set Eclipse to make it compatible with Java 6. This is done by right-clicking the project, clicking on Properties, and choosing Java Compiler. Use the drop-down menu to choose the “Compiler Compliance Level”.

EDIT: Also, Java 7 isn’t even on www.java.com yet so it has not been pushed out to the general public yet.

I see, thanks for the reply :slight_smile: Do you have any idea if java 7 will be widely distributed in a couple of months or will it be a very slow process?

since java 6 (openjdk6) is still default on linux - and switching it manually is just such a pain, I changed my code back to java 6

by now this only meant to change the string switch cases

but oh well… is it really that much nicer to use switch case instead of if else ?
you have to use break everytime and stuff…

so yeah I just switched back

other than that I like the 1_000_000 thing, but dont really use it yet
and well java7 is much faster they say, so when running (and when distributing a game with a private jvm) I choose java7

For schools, it will probably be at least another year, as lots of institutions upgrade their software during the summer holidays.

If you do chose to target 6, then I’d recommend developing on 6 too, instead of 7. Although you can set Java 7 to target Java 6, there is nothing to stop you accidentally using any new classes or methods which are exclusive to 7.

@Cero: I prefer using switch statements over if else because i find it easier to organize without all the curly braces, just my personal opinion and it would be great to organize the contents of my program with switch statements since it uses a lot of strings. I want it to be easy and stable for the user, but on the same time i want to have a somewhat pleasant time coding the application.

@JL235: Thank you, i didn’t know that about schools. It is settled then, i will continue using java 6 for this project, thanks :slight_smile:

np. I used to work part time for the Greenfoot team, which is also a Java application aimed at schools. Java 6 was released 5 years ago, yet they only officially switched from Java 5 to 6 earlier this year. Even then they still compile Greenfoot to target Java 5, as they still have users on that.

My school’s computers have been using Java 6u16 for years until they got new computers, which had 6u26! And the current version is 6u29 :cranky:

If you really want to use the new features in Java 7, I suggest you distribute the JRE7 with your application and have a BAT file or an EXE file that runs your program :slight_smile:

I recommend you stick with Java 6. Unless you really, really, want the new features provided by the Java 7 library, Java 6 is the better choice. Especially for schools, which always have a hard time upgrading their computers and software.