17 copyright © 2005, oracle. all rights reserved. deploying applications by using java web start

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

Upload: melissa-schultz

Post on 27-Mar-2015

216 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: 17 Copyright © 2005, Oracle. All rights reserved. Deploying Applications by Using Java Web Start

17Copyright © 2005, Oracle. All rights reserved.

Deploying Applications by UsingJava Web Start

Page 2: 17 Copyright © 2005, Oracle. All rights reserved. Deploying Applications by Using Java Web Start

17-2 Copyright © 2005, 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

Page 3: 17 Copyright © 2005, Oracle. All rights reserved. Deploying Applications by Using Java Web Start

17-3 Copyright © 2005, Oracle. All rights reserved.

What Is Java Web Start?

• 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.

Page 4: 17 Copyright © 2005, Oracle. All rights reserved. Deploying Applications by Using Java Web Start

17-4 Copyright © 2005, 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).

HTTP

HTTP

1 2

3

4

Page 5: 17 Copyright © 2005, Oracle. All rights reserved. Deploying Applications by Using Java Web Start

17-5 Copyright © 2005, Oracle. All rights reserved.

Advantages of Web Start

• 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

Page 6: 17 Copyright © 2005, Oracle. All rights reserved. Deploying Applications by Using Java Web Start

17-6 Copyright © 2005, 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

Page 7: 17 Copyright © 2005, Oracle. All rights reserved. Deploying Applications by Using Java Web Start

17-7 Copyright © 2005, 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

Page 8: 17 Copyright © 2005, Oracle. All rights reserved. Deploying Applications by Using Java Web Start

17-8 Copyright © 2005, Oracle. All rights reserved.

Creating the Deployment Profile File

Select File > New

Page 9: 17 Copyright © 2005, Oracle. All rights reserved. Deploying Applications by Using Java Web Start

17-9 Copyright © 2005, Oracle. All rights reserved.

Saving the Deployment Profile

Select a destination and name for the deployment profile.

Page 10: 17 Copyright © 2005, Oracle. All rights reserved. Deploying Applications by Using Java Web Start

17-10 Copyright © 2005, Oracle. All rights reserved.

Selecting Files to Deploy

Select the file types to include. Other settings differ for other deployment profile types.

Page 11: 17 Copyright © 2005, Oracle. All rights reserved. Deploying Applications by Using Java Web Start

17-11 Copyright © 2005, 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.

Page 12: 17 Copyright © 2005, Oracle. All rights reserved. Deploying Applications by Using Java Web Start

17-12 Copyright © 2005, Oracle. All rights reserved.

Creating and Deploying the Archive File

• Right-click the Deployment Profile file.

• Select the Deploy to menu option.

• The .jar file is created in the directory listed in the deployment properties.

Page 13: 17 Copyright © 2005, Oracle. All rights reserved. Deploying Applications by Using Java Web Start

17-13 Copyright © 2005, Oracle. All rights reserved.

Using JDeveloper to Deploy an Applicationto Java Web Start

Step 1: Generate deployment profiles and archive the application.

Step 2: Start OC4J and create a connection.

Step 3: Use Web Start Wizard to create JNLP file.

Step 4: Archive and deploy your application to OC4J server.

Page 14: 17 Copyright © 2005, Oracle. All rights reserved. Deploying Applications by Using Java Web Start

17-14 Copyright © 2005, Oracle. All rights reserved.

Step 1: Generate Deployment Profiles and Archive Application

Package all the Java application files into a simple .jar archive.

Page 15: 17 Copyright © 2005, Oracle. All rights reserved. Deploying Applications by Using Java Web Start

17-15 Copyright © 2005, Oracle. All rights reserved.

Step 2a: Start OC4J

Use the command line to start the server.

Page 16: 17 Copyright © 2005, Oracle. All rights reserved. Deploying Applications by Using Java Web Start

17-16 Copyright © 2005, Oracle. All rights reserved.

Step 2b: Creating a Connection

Use the Connection Wizard to create a connection to the application server. You must specify:

• The type of connection (OC4J)

• The username and password for authentication

• Local URL, target Web site, and local directory for OC4J

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

17-17 Copyright © 2005, Oracle. All rights reserved.

Step 3: Use Web Start Wizard to Create a JNLP File

• 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)

Page 18: 17 Copyright © 2005, Oracle. All rights reserved. Deploying Applications by Using Java Web Start

17-18 Copyright © 2005, Oracle. All rights reserved.

Step 4: Archive and Deploy the Application to the OC4J Server

• Specify properties of the Web components and deployment description.

• Deploy to the OC4J connection created in step 2.

• Run the generated HTML file.

Page 19: 17 Copyright © 2005, Oracle. All rights reserved. Deploying Applications by Using Java Web Start

17-19 Copyright © 2005, 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

Page 20: 17 Copyright © 2005, Oracle. All rights reserved. Deploying Applications by Using Java Web Start

17-20 Copyright © 2005, 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 OC4J server preference

• Installing and starting the stand-alone OC4J application server

• Creating an application server connection in JDeveloper

• Archiving and deploying the application files to OC4J, and testing the application