3

The topic-title speaks for itself. Is it possible to check if the client has JDK installed trough javascript? I know that it is possible to check the os and the browser but is that possible too?

4 Answers 4

3

You can check whether the client has java enabled with window.navigator.javaEnabled().

Note that:

The return value for this method indicates whether the preference that controls Java is on or off - not whether the browser offers Java support in general.

For more information, have a look at https://developer.mozilla.org/en/DOM/window.navigator.javaEnabled

Sign up to request clarification or add additional context in comments.

Comments

3

I am presuming you have an Applet or a Web Start application which you want to run.

For those cases Oracle provides the Java Deployment Toolkit JavaScript which helps to detect Java versions and also offers methods to automatically write applet tags and Web Start launcher buttons.

As you can see at http://download.oracle.com/javase/6/docs/technotes/guides/jweb/deployment_advice.html#deplToolkit (also contains link to downloading .js file) it can retrieve installed JREs or send the user to installation page of latest one. This might be what you are looking for.

Notes:

  • This applies to detecting JREs. JDKs aren't used by the browser so there isn't a need to detect them.
  • It might not work because of privacy settings or other browser/JRE configuration options.

Comments

0

I don't think you can. It would require javascript to access information beyond your browser. Maybe there's some browser specific solutions.

Comments

0

Its not possible to know the version of Java through javascript .If its possible then it will be a security breach.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.