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?
Asked
Active
Viewed 163 times
1
-
Well, this is really vague... what kind of application is this ? – Dici Nov 01 '14 at 13:43
-
A basic video game, which is based on swing. – Coderino Javarino Nov 01 '14 at 13:44
-
How users get access to the application ? What kind of problems do they encounter ? Can they start the application with some bugs or can't they start it at all ? – Dici Nov 01 '14 at 13:46
-
It works fine until it faces the lambda expression, or the for each loop. – Coderino Javarino Nov 01 '14 at 13:57
2 Answers
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
-
Thanks, it looks like exactly what I was looking for. Will accept the answer when I check if it works. – Coderino Javarino Nov 01 '14 at 13:58
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