Sie sind auf Seite 1von 20

17

Deploying Applications
by Using Java Web Start

Copyright © 2007, 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 Java Web Start

17-2 Copyright © 2007, Oracle. All rights reserved.


Java Web Start

• Is an application-deployment technology based on


the Java 2 platform
• Launches full-featured applications via any
browser on any platform, from anywhere on the
Web

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


Running a Web Start Application

1. Request the
application.
2. Launch Web Start on
1 HTTP 2
the local machine.
3. Download the
application.
3
4. Launch the
HTTP
application (Draw).
4

17-4 Copyright © 2007, Oracle. All rights reserved.


Advantages of Web Start

• Is as easy to deploy as HTML


• 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

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


Examining the JNLP File

The JNLP file defines:


• The location of the application resources
• Information that appears while the application loads
• What the application resources are

17-6 Copyright © 2007, 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 © 2007, Oracle. All rights reserved.


Creating the Deployment Profile File

Select File > New.

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


Saving the Deployment Profile

Select a destination and name for the deployment


profile.

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


Selecting Files to Deploy

Select the file types to include. Settings differ for other


deployment profile types.

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


Creating an Executable .jar File

Set the Main Class field to the class name containing a


main() method in JAR Options.

17-11 Copyright © 2007, Oracle. All rights reserved.


Creating and Deploying the Archive File

1. Right-click the Deployment Profile file.


2. Select the “Deploy to JAR file” menu option.
3. The .jar file is created in the directory listed in
the deployment properties.

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


Using JDeveloper to Deploy an Application
for 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 a JNLP file.
Step 4: Archive and deploy your application to OC4J
server.

17-13 Copyright © 2007, 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 © 2007, Oracle. All rights reserved.


Step 2a: Start OC4J

Use the command line to start the server.

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

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


Step 3: Use the Web Start Wizard
to Create a JNLP File
• Specify the Web Start application 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).

17-17 Copyright © 2007, 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.
17-18 Copyright © 2007, 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 © 2007, Oracle. All rights reserved.


17-20 Copyright © 2007, Oracle. All rights reserved.

Das könnte Ihnen auch gefallen