Oracle announced that the Java Applet and Web Start functionality, including the Applet API, Java plug-in, Java Applet Viewer, JNLP and Java Web Start including the javaws tools are all deprecated in JDK 9 and will be removed in a future release. As an alternative, our customers are recommended to use the Nexaweb Launcher to deploy and run Nexaweb web applications.
This step-by-step guide shows how to perform the migration of Nexaweb application to Nexaweb launcher.
- Nexaweb Launcher is based on an open source project GetDown. For information on GetDown project, please refer to: GetDown
- For more information on Nexaweb Launcher, please refer to: Nexaweb Launcher
- For more information on Nexaweb Standalone Client, please refer to: Standalone Client
Prerequisites:
- Nexaweb Platform with version 4.5.66 or higher
- Nexaweb Launcher Installer
You can find the installers at the Nexaweb download page.
Step-by-step guide
To deploy a Nexaweb application using Nexaweb Launcher, the recommended approach is to use the Nexaweb Standalone Client. Here are the steps:
- Create a run.nexaweb file for launching Nexaweb web application
The way to create Nexaweb web application is by using a run.nexaweb (Nexaweb Launching Protocol) file deployed on the server. When the user types the URL of a Nexaweb file in the browser, the application will detect that the response is a Nexaweb file and it will start Nexaweb launcher to load the Web Start application according to the setting in the Nexaweb file. So a Nexaweb file needs to be created for the Nexaweb application.
- Download the latest version of Nexaweb Platform (4.5.65.0009 or later) and install it on the server
- Download and install Nexaweb Launcher on the client machine.
- Create a new Nexaweb application project
- Copy NexawebImages.jar, NexawebStandaloneClient.jar, and all other jars to WebContent directory as below:
Note: You can find NexawebStandaloneClient.jar and NexawebImages.jar in the bin directory where Nexaweb Platform is installed
d. Edit web.xml to add runNexaweb JSP and /runNexaweb URL mapping as below:
d1. At line #62:
<servlet>
<servlet-name>RunNexaweb</servlet-name>
<display-name>RunNexaweb</display-name>
<description/>
<servlet-class>
com.nexaweb.server.jnlp.replacement.RunNexawebServlet
</servlet-class>
</servlet>
d2. At line #109:
<servlet-mapping>
<servlet-name>RunNexaweb</servlet-name>
<url-pattern>/runNexaweb</url-pattern>
</servlet-mapping>
e. Run the project on a web server, go to the URL: http://localhost:8080/nxRunNexaweb/runNexaweb, and save run.nexaweb
2. Digest the jars and create digest.txt and digest2.txt and upload them to the nexaweb application
Nexaweb launcher uses Getdown’s digester to generate jar’s digest and use the digest to check if it needs to download a new version jar file or not. So the users need to digest all jars the web application needed and put them in the same directory with GetDown.txt which is just the same file run.nexaweb in a different name. After generating the digest files, they need to be added into WebContent directory too as the jars.
a. Create a local folder called "target". Copy getdown-1.7.1-SNAPSHOT.jar from Nexaweb Launcher installation folder and paste it into the target folder
b. Copy the run.nexaweb file at step #d2 into this target folder
c. Create a "digesters" sub-folder under target and again copy run.nexaweb file into this folder. Change its name to getdown.txt (Note: please check if the file extension is .txt after changing the name )
d. Copy NexawebImages.jar, and NexawebStandaloneClient.jar in the digesters directory
e. Copy all jars other than above jars in the ClientClassLoader directory, and the digesters directory looks as below:
Note: the demo project uses an external jar called test.jar. It is put under ClientClassLoader directory, which is as below. If the project does not needs of jars other than NexawebImages.jar, and NexawebStandaloneClient.jar , you don't need create a ClientClassLoader directory.
f. Run the command below in command lines below:
1 Change the command prompt to the target folder
2. Run command - java -classpath getdown-1.7.1-SNAPSHOT.jar com.threerings.getdown.tools.Digester digesters
Note: "D:\target" is the directory where getdown-1.7.1-SNAPSHOT.jar is put in and "digesters" is the directory to be digested in the above command
and it creates two digest files as the screenshot below:
g. Copy these two digest files to the Nexaweb project’s WebContent folder as below :
h. Restart the Nexaweb project and all the setting needed for Nexaweb launcher are done .
Note: whenever the jar files are changed, they need to be re-digested
3. Launch the Nexaweb web application
a. Start the server which was configured for the Nexaweb project
b. Double click run.nexaweb in the target folder to launch the Nexaweb web application
Related articles
JDK 9 Release Notes Deprecated APIs, Features, and Options