17 Deploying Applications by Using Java Web Start

17 Deploying Applications by Using Java Web Start Copyright © 2004, Oracle. All rights reserved.

Objectives After completing this lesson, you should be able to do the following: • Define the architecture of Java Web Start • Describe the benefits of using Java Web Start • Deploy an application by using Web Start 17 -2 Copyright © 2004, Oracle. All rights reserved.

What Is Java Web Start? • • 17 -3 It is an application deployment technology based on the Java 2 platform. It launches full-featured applications via any browser on any platform, from anywhere on the Web. Copyright © 2004, Oracle. All rights reserved.

Running a Web Start Application 1. Request the application. 2. Launch Web Start on the local machine. 3. Download the application. 4. Launch the application (Draw). 17 -4 1 2 HTTP Copyright © 2004, Oracle. All rights reserved. 3 HTTP 4

Advantages of Web Start • • • 17 -5 Renders a very responsive and rich user interface Launches applications from the Start menu on the desktop Does not require browser to be running Allows applications to work offline Automatically updates applications when invoked Copyright © 2004, Oracle. All rights reserved.

Examining the JNLP File The JNLP files defines: • The location of the application resources • Information that appears while the application loads • What the application resources are 17 -6 Copyright © 2004, Oracle. All rights reserved.

Deploying Applications with JDeveloper The JDeveloper Deployment Profile Wizard: • Detects interclass dependencies • Creates. ear, . war, . jar, or. zip files • • Enables you to have control over other files added to the deployed archive Enables you to save deployment profile settings in project files: – To simplify redeployment when code changes – That can be automatically updated with new classes as they are added to the project 17 -7 Copyright © 2004, Oracle. All rights reserved.

Creating the Deployment Profile File Select File > New 17 -8 Copyright © 2004, Oracle. All rights reserved.

Saving the Deployment Profile Select a destination and name for the deployment profile. 17 -9 Copyright © 2004, Oracle. All rights reserved.

Selecting Files to Deploy Select the file types to include. Other settings differ for other deployment profile types. 17 -10 Copyright © 2004, Oracle. All rights reserved.

Making an Executable. jar File Set the Main Class field to the class name containing a main() method, in JAR Options. 17 -11 Copyright © 2004, Oracle. All rights reserved.

Creating and Deploying the Archive File • • • 17 -12 Right-click the Deployment Profile. Select the Deploy to menu option. The. jar file is created in the directory listed in the deployment properties. Copyright © 2004, Oracle. All rights reserved.

Using JDeveloper to Deploy an Application to Java Web Start Step 1: Generate deployment profiles and archive the application. Step 2: Start OC 4 J and create a connection. Step 3: Use Web Start Wizard to create JNLP file. Step 4: Archive and deploy your application to OC 4 J server. 17 -13 Copyright © 2004, Oracle. All rights reserved.

Step 1: Generate Deployment Profiles and Archive Application Package all the Java application files into a simple. jar archive. 17 -14 Copyright © 2004, Oracle. All rights reserved.

Step 2 a: Start OC 4 J Use the command line to start the server. 17 -15 Copyright © 2004, Oracle. All rights reserved.

Step 2 b: Creating a Connection Use the Connection Wizard to create a connection to the application server. You must specify: • The type of connection (OC 4 J) • The username and password for authentication • Local URL, target Web site, and local directory for OC 4 J 17 -16 Copyright © 2004, Oracle. All rights reserved.

Step 3: Use Web Start Wizard to Create a JNLP File 17 -17 • Specify the Web Start name, application archive (. jar), and main application class. • Include information to be displayed to the user while downloading (for example, application title, vendor, and brief description) Copyright © 2004, Oracle. All rights reserved.

Step 4: Archive and Deploy the Application to the OC 4 J Server 17 -18 • Specify properties of the Web components and deployment description. • • Deploy to the OC 4 J connection created in step 2. Run the generated HTML file. Copyright © 2004, Oracle. All rights reserved.

Summary In this module, you should have learned how to: • Describe how a Java Web Start application runs • Describe the benefits of using Java Web Start • Use JDeveloper to deploy an application by using Web Start 17 -19 Copyright © 2004, Oracle. All rights reserved.

Practice 17: Overview This practice covers the following topics: • Archiving your Java application • Creating a new project to hold the Web Start files and setting the OC 4 J server preference • Installing and starting the stand-alone OC 4 J application server • Creating an application server connection in JDeveloper • Archiving and deploying the application files to OC 4 J, and testing the application 17 -20 Copyright © 2004, Oracle. All rights reserved.
- Slides: 20