1

Recently I switched to java 1.8, however this started to cause me troubles, as users that have older versions are unable to start my app. Is there any common method to deal with it, ie tell the user that his jre is outdated for the app and somehow direct it to the required one's download page?

Coderino Javarino
  • 2,819
  • 4
  • 21
  • 43

2 Answers2

2
if(!System.getProperty("java.version").startsWith("1.8")) {
        // open website
}

How do you open a website? Check in this question.

However, this is code for it. This might not be it what you are looking for

Community
  • 1
  • 1
engineercoding
  • 832
  • 6
  • 14
0

Change compiler level to earlier version in your IDE, this way you can compile your code so that it can be understood by earlier version.

However, if you are using java 8 specific features such as lambdas, this will not work.

Problem with checking version in your program is that for that program to run, they need to have java 8 already.

Only way this could be solved is, running your prgram through a batch file or shell script

Buddha
  • 4,339
  • 2
  • 27
  • 51