Search code examples
javajava-7java-6

Is it safe to run an applicaton written in Java 6 with Java 7?


I am working on an ERP system that was written in Java 6.

On startup it is enforced that Java 6 is used with code like this:

if (!System.getProperty("java.version").startsWith("1.6"))
    // terminate

As far as I'm aware, Java 7 is designed to be able to run applications that were developed in earlier versions.

Should it be relatively safe to "break" this check? What are the problems I could run into?


Solution

  • Should it be relatively safe to "break" this check? What are the problems I could run into?

    Yes. I would assume that check is to prevent you from running on earlier versions (or unsupported versions). It could stop working. And, it might violate any support contracts you have. It's possible they're using JNI or JNA to do something with incompatible native libraries. It's possible they're using custom object serialization that won't work.

    Of course, it might work. We can't guarantee it (or test it for you).