views:

255

answers:

2

Hi,

How can you determine the minimum version of Java required on a client's browser to run an applet that I've developed? I would like to do this so that I can determine, through, javascript, if the browser the user is running is capable of running my applet and displaying a message if not.

Thanks in advance, Tim

+1  A: 

Your compiler setting will tell you a lot of that. What target are you using in the javac element of the ant script (or the target setting of whatever IDE you are using)? If this is 1.5, then 1.5 would be the minimum to run your app.

Do you use generics? If so, then (short of running one of the retrotranslators) you will require 1.5+.

Similarly, you can compile your code against the older libs (1.4, etc) to determine if you are using any APIs that were not available then.

jsight
Hello, I am using intellijIDEA 6.0 for compiling my applet. I know for a fact that the applet does not work with Java 1.4 but I am not sure about the other versions?!Thanks,Tim
I don't have Intellij here to try, but I bet you could look at the project settings to see what target language it is. The docs are here: http://www.jetbrains.com/idea/webhelp/index.jsp?configuring-project-jdk.html . See what the oldest version is that will compile it.
jsight
Thanks a lot jsight...I will take a look at it!
A: 

Hi Tim,

If you are using Eclipse to develop your applet you can just change compliance level and check that your program still compile. To do this go to Windows -> preferences -> java -> Compiler or something like that

If you are not using eclipse i guess you can change java compile compliance level on the javac command line.

Manuel Selva
Hello Manuel,Is there a similar setting for intellijIDEA 6.0?