Movatterモバイル変換


[0]ホーム

URL:


Documentation

The Java™ Tutorials
Deployment In-Depth
User Acceptance of RIAs
Deployment Toolkit
Deploying an Applet
Embedding JNLP File in Applet Tag
Deploying a Java Web Start Application
Changing the Launch Button
Deploying Without Codebase
Checking the Client JRE Software Version
Java Network Launch Protocol
Structure of the JNLP File
Deployment Best Practices
Reducing the Download Time
Avoiding Unnecessary Update Checks
Ensuring the Presence of the JRE Software
Questions and Exercises
Trail: Deployment
Lesson: Deployment In-Depth
Section: Deployment Toolkit
Home Page >Deployment >Deployment In-Depth
« Previous • Trail • Next »

The Java Tutorials have been written for JDK 8. Examples and practices described in this page don't take advantage of improvements introduced in later releases and might use technology no longer available.
SeeDev.java for updated tutorials taking advantage of the latest releases.
SeeJava Language Changes for a summary of updated language features in Java SE 9 and subsequent releases.
SeeJDK Release Notes for information about new features, enhancements, and removed or deprecated options for all JDK releases.

Checking the Client JRE Software Version

There are many reasons to check if a particular version of the Java Runtime Environment (JRE) software is available on a client machine. For example, you might want to launch a different version of your rich Internet application (RIA) or redirect the user to a different page depending on the client's JRE software version.

Use the Deployment Toolkit script'sversionCheck function to check if a particular version or range of JRE versions is installed on the client.

Function signature:versionCheck: function(versionPattern)

Parameters:

Usage: Creating a different user experience depending on the client's JRE software version

In this example, a Launch button is created for the Notepad application only if the version of JRE software on the client is greater than or equal to 1.6. If not, the browser is redirected tooracle.com.

   <script src="https://www.java.com/js/deployJava.js"></script><script>    if (deployJava.versionCheck('1.6+')) {                    var url = "https://docs.oracle.com/javase/tutorialJWS/deployment/webstart/examples/Notepad.jnlp";                <!-- you can also invoke deployJava.runApplet here -->        deployJava.createWebStartLaunchButton(url, '1.6.0');     } else {        document.location.href="http://oracle.com";    }</script>

Note: Depending on the client's operating system and version of the Java platform, you might be able to verify version information for JRE software at the major version level (for example, 1.6) or at a finer update level (for example, 1.6.0_10).
« PreviousTrailNext »

About Oracle |Contact Us |Legal Notices |Terms of Use |Your Privacy Rights

Copyright © 1995, 2024 Oracle and/or its affiliates. All rights reserved.

Previous page: Deploying Without Codebase
Next page: Java Network Launch Protocol

[8]ページ先頭

©2009-2025 Movatter.jp