Packaging and Deploying Java Projects in Forte



Similar documents
Primavera P6 Professional Windows 8 Installation Instructions. Primavera P6. Installation Instructions. For Windows 8 Users

For Introduction to Java Programming, 5E By Y. Daniel Liang

Supplement I.B: Installing and Configuring JDK 1.6

Supplement I.B: Installing and Configuring JDK 1.6

Java. How to install the Java Runtime Environment (JRE)

Getting Started using the SQuirreL SQL Client

Troubleshooting Guide. 2.2 Click the Tools menu on Windows Explorer 2.3 Click Folder Options. This will open a dialog box:

WA2262 Applied Data Science and Big Data Analytics Boot Camp for Business Analysts. Classroom Setup Guide. Web Age Solutions Inc.

Installing (1.8.7) 9/2/ Installing jgrasp

Installation of IR under Windows Server 2008

etoken Enterprise For: SSL SSL with etoken

ENABLE LOGON/LOGOFF AUDITING

Installing Primavera P6 Professional R8.2

Remote Vision(Java RDP Client) User Manual

Learn how to create web enabled (browser) forms in InfoPath 2013 and publish them in SharePoint InfoPath 2013 Web Enabled (Browser) forms

Mapping ITS s File Server Folder to Mosaic Windows to Publish a Website

SECURE MOBILE ACCESS MODULE USER GUIDE EFT 2013

USING STUFFIT DELUXE THE STUFFIT START PAGE CREATING ARCHIVES (COMPRESSED FILES)

Option 1 Using the Undelete PushInstall Wizard.

How to Install Eclipse. Windows

ABS2020 Moving Airfreight Forward

SQL Server 2005: Report Builder

NETWRIX CHANGE NOTIFIER

Crystal Reports for Eclipse

Download and Installation Instructions. Java JDK Software for Windows

Eclipse installation, configuration and operation

Installing and Using No Machine to connect to the Redhawk Cluster. Mac version

NetBeans IDE Field Guide

Mesa DMS. Once you access the Mesa Document Management link, you will see the following Mesa DMS - Microsoft Internet Explorer" window:

How to use FTP Commander

Installing Globodox Web Client on Windows 7 (64 bit)

Virtual Office Remote Installation Guide

Java Software Development Kit (JDK 5.0 Update 14) Installation Step by Step Instructions

How to setup a VPN on Windows XP in Safari.

1/4/12 Installing and Configuring WebDAV on IIS 7 : WebDAV for IIS 7.0 : Publishing Content to Web Sites : T

Installing Ruby on Windows XP

GE Intelligent Platforms. Activating Licenses Online Using a Local License Server

KeePass Getting Started on Windows

Practice Fusion API Client Installation Guide for Windows

Witango Application Server 6. Installation Guide for Windows

Running Argos via VPN client

Producing Standards Based Content with ToolBook

How to use the Eclipse IDE for Java Application Development

T320 E-business technologies: foundations and practice

Java with Eclipse: Setup & Getting Started

Getting Started with Android Development

DEPLOYING A VISUAL BASIC.NET APPLICATION

Tutorial: setting up a web application

Changing Your Cameleon Server IP

Virtual Owl. Guide for Windows. University Information Technology Services. Training, Outreach, Learning Technologies & Video Production

Oracle Java (8u31) Installation

Introduction to TightVNC. Installation. TightVNC for Windows: Installation and Getting Started. TightVNC Version 2.6 Copyright 2012 GlavSoft LLC.

Creating Reports with Microsoft Dynamics AX SQL Reporting Services

enter the administrator user name and password for that domain.

Building Java Servlets with Oracle JDeveloper

Table of Contents. Welcome Login Password Assistance Self Registration Secure Mail Compose Drafts...

Supplement I.C. Creating, Compiling and Running Java Programs from the Command Window

Outlook to Windows Live Mail

Symantec Client Firewall Policy Migration Guide

Software Development Environment. Installation Guide

Rogue Wave HostAccess 7.40J Installation Guide... 1

Using Remote Web Workplace Version 1.01

Launcher Installation Instructions Code No. LIT Software Release 1.5 Issued June 2016

SunGard Banner Documentation

Code Estimation Tools Directions for a Services Engagement

PC Agent Quick Start. Open the Agent. Autonomy Connected Backup. Version 8.8. Revision 0

ProjectWise Mobile Access Server, Product Preview v1.1

Entrust Managed Services PKI Administrator Guide

NetWrix File Server Change Reporter. Quick Start Guide

Create, Link, or Edit a GPO with Active Directory Users and Computers

Omnixx Client Installer for TXDPS

Implementing a SAS 9.3 Enterprise BI Server Deployment TS-811. in Microsoft Windows Operating Environments

Using Impatica for Power Point

Sophos Anti-Virus for NetApp Storage Systems startup guide

Quick Guide: Troubleshooting Info from SNAP PAC Systems

Comodo MyDLP Software Version 2.0. Endpoint Installation Guide Guide Version Comodo Security Solutions 1255 Broad Street Clifton, NJ 07013

Microsoft Outlook 2000 Configuration Creation of a SPAM Filter

Installing Microsoft Outlook on a Macintosh. This document explains how to download, install and configure Microsoft Outlook on a Macintosh.

MultiSite Manager. Setup Guide

Business Objects Enterprise version 4.1. Report Viewing

How to install FlexiCAD 3

Configuring.NET based Applications in Internet Information Server to use Virtual Clocks from Time Machine

STUDENT ACTIVITY _KEY: CONFIGURING CONTROL PANEL OPTIONS AND DESKTOP SETTINGS

Accessing the Online Meeting Room (Blackboard Collaborate)

Java Language Tools COPYRIGHTED MATERIAL. Part 1. In this part...

WA1826 Designing Cloud Computing Solutions. Classroom Setup Guide. Web Age Solutions Inc. Copyright Web Age Solutions Inc. 1

Installing the Android SDK

How schedule AccuTRConsole to run every hour

JAVS Scheduled Publishing. Installation/Configuration... 4 Manual Operation... 6 Automating Scheduled Publishing... 7 Windows XP... 7 Windows 7...

Click Start > Control Panel > System icon to open System Properties dialog box. Click Advanced > Environment Variables.

Last modified on for application version 4.4.4

InformationNOW SQL 2005 Database Backup and Restoration

Web UTAS. Common problems and solutions. Common problems with Java settings. Ensuring that you have the correct Java settings in place

ELM Server Exchange Edition Virtual Archive Mailbox version 5.5

Stellar Phoenix Exchange Server Backup

LPR for Windows 95/98/Me/2000/XP TCP/IP Printing User s Guide. Rev. 03 (November, 2001)

BIGPOND ONLINE STORAGE USER GUIDE Issue August 2005

Backing Up and Restoring the Database

How to install and use the File Sharing Outlook Plugin

Transcription:

CHAPTER 8 Packaging and Deploying Java Projects in Forte This chapter introduces to use Forte s Archive wizard to package project files for deployment. You will also learn how to create shortcut for applications on Windows. 8.1 Java Archiving Your project may consist of many classes and supporting files, such as image files and audio files. All of these files have to be provided to the end-users if your programs are to run on their side. For convenience, Java supports an archive file that can group all the project files in a compressed file. The Java archive file format (JAR) is based on the popular ZIP file format. JAR can be used as a general archiving tool, but transporting Java applications, applets, and their requisite components (.class files, images, and sounds) in a single file was the primary motivation for its development. This single file can be deployed on an end-user s machine as an application. It also can be downloaded to a browser in a single HTTP transaction, rather than opening a new connection for each piece. This greatly simplifies application deployment and improves the speed with which an applet can be loaded onto a Web page and begin functioning. The JAR format also supports compression, which reduces the size of the file and improves download time still further. Additionally, individual entries in a JAR file can be digitally signed by the applet author to authenticate their origin. You can create an archive file using the JDK jar command or using the Archive wizard. The following command creates an archive file named WelcomeApplet.jar for classes WelcomeApplet.class: jar -cf WelcomeApplet.jar WelcomeApplet.class The -c option is for creating a new archive file, and the -f option specifies the archive file s name. 8.2 Using the Archive Wizard to Package Projects With the jar command, you have to manually identify the dependent files. Forte provides the Archive wizard that 83

gathers all the classes on which your program depends into one JAR archive that includes image and audio files. Let us use the WelcomeApplet class in Chapter 2, Creating and Testing Applets," to demonstrate packaging projects. To create a JAR file in Forte, you must first create a JAR contents file. The JAR contents file stores information about your JAR file, which you can later modify and use to create a new JAR file. 8.2.1 Creating JAR Content Files Here are the steps to create a JAR contents file for the WelcomeApplet class. 1. In the context menu of the c:\tutorial node in the Explorer, choose New, Java Packager, Jar Recipe to display the Archive wizard, as shown in Figure 8.1. Figure 8.1 The Archive wizard enables to specify recipe for the archive. To create a JAR file in Forte, you must first create a JAR contents file. The JAR contents file stores information about your JAR file, which you can later modify and use to create a new JAR file. 4.2.1 Creating JAR Content Files Here are the steps in creating a JAR contents file for the WelcomeApplet class. 1. In the context menu of the c:\tutorial node in the Explorer, choose New, Java Packager, Jar Recipe to display the JAR Recipe wizard, as shown in Figure 8.2. 84

Figure 8.2 You can create a JAR recipe using the Jar Recipe wizard. 2. Type WelcomeAppletJarRecipe in the Recipe Name field, WelcomeApplet.jar in the Generated JAR Name field, and click Next to display the Specify Recipe Contents panel, as shown in Figure 8.3. Figure 8.3 You can add class files and other resource files to the JAR content. 3. Choose WelcomeApplet and add it to the Source pane. Click Next to display the Modify JAR Recipe Contents panel, as shown in Figure 8.4. Click Next to display the JAR Manifest panel, as shown in Figure 8.5. 85

Figure 8.4 You can modify JAR Recipe Contents in the wizard. Figure 8.5 You can generate and modify a manifest file in the JAR Manifest panel. 4. In the Generation section of the JAR Manifest panel, choose Basic Main Attributes and click the Generate button to generate the manifest information. Add the following line to specify a main class so you can run the class from the JAR standalone, as shown in Figure 8.6. Main-Class: mortgagedemo.computemortgage 86

Figure 8.6 The manifest file is generated. 5. Click Finish to generate the JAR content file. A filesystem node for the JAR content file with the icon ( ) appears in the Explorer, as shown in Figure 8.7. Since you specified mortgage as the JAR file in Figure 8.2, the label for this node is mortgage. Figure 8.7 The WelcomeAppletJarRecipe node appears in the Explorer. NOTE: If you show the directory in c:\tutorial, you will see the file WelcomeApplet.jarContent, as shown in Figure 8.8. This file describes the contents of the JAR file to be created. 87

Figure 8.8 JAR content file describes the contents in the archive. 8.2.2 Generating JAR Files To generate the actual JAR specified by the content file, choose Compile from the context menu of the JAR Recipe file node (WelcomeAppletJarRecipe) in the Explorer. A JAR file named WelcomeApplet.jar is now created. To modify the JAR file, you have to modify the JAR content file and recompile the JAR content file. To modify the JAR content file, choose the JAR content file node in the Explorer, and choose Properties to display the Properties window, as shown in Figure 8.9. Click the ellipsis button in the Manifest field to display the property editor for the manifest file, as shown in Figure 8.10. 88

Figure 8.9 You can modify the JAR recipe file in the Properties window for the recipe file. Figure 8.10 You can modify the manifest file in the Manifest property editor. NOTE: If your Java source code is changed, you need to update the.jar file. You can do this by choosing Compile in the context menu of the JAR recipe file node in the Explorer. 8.3 Running Archived Projects The JAR file packages all the class files and dependent resource files into one compressed file that can be distributed to the end-user. If the project is a Java application, the user should have a Java Runtime Environment already installed. If it is not installed, the user can download Java Runtime Environment (JRE) from JavaSoft at www.javasoft.com/ and install it. NOTE: The Java Runtime Environment is the minimum standard Java platform for running Java 89

programs. It contains the Java interpreter, Java core classes, and supporting files. The JRE does not contain any of the development tools (such as Applet Viewer or javac) or classes that pertain only to a development environment. The JRE is a subset of JDK. 8.3.1 Running Archived Files from Java Applications You can run a JAR file if a main class is specified in the manifest. To run it from Forte, simply choose Execute from the context menu of the JAR content node in the Explorer. You can also run it from the DOS prompt using the java command with the -jar option, as follows: java jar WelcomeApplet.jar NOTE: You can create an icon on the Windows Desktop to enable the end-user to run the program by double-clicking on it. To learn how to do this, see Section 8.4, Creating Shortcut for Java Applications on Windows. 8.3.2 Running Archived Files from Java Applets To run WelcomeApplet as an applet from the JAR file, you need to include an ARCHIVE attribute in the HTML file. The ARCHIVE attribute specifies the archive file that contains the applet. For example, shown below is how you would modify the HTML file for running WelcomeApplet: <applet > codebase=.. code="welcomeapplet.class" archive = "WelcomeApplet.jar" width = 400 height = 300 </applet> 8.4 Create Shortcut for Java Applications on Windows You can create an icon on Windows Desktop, so that the enduser can use it to start the program by double-clicking on it. Here are the steps to make a shortcut to run a Java program: 1. Right click on the desktop and choose New, Shortcut to display the Create Shortcut wizard, as shown in Figure 8.11. 2. Type java -jar WelcomeApplet.jar in the text box as shown in Figure 8.11. Click Next to display the dialog box as shown in Figure 8.12. 90

3. Type WelcomeApplet as the name for the shortcut in Figure 8.12 and click Finish to create the shortcut, as shown in Figure 8.13. 4. Right click the WelcomeApplet shortcut you just created and select Properties to display the WelcomeApplet Properties dialog box as shown in Figure 8.14. 5. Type c:\liang in the Start in field. This folder contains WelcomeApplet.jar. Click OK to close the WelcomeApplet Properties dialog box. You can now double click WelcomeApplet on the desktop to run the WelcomeApplet application. 6. (Optional) You can set a custom icon for the application by clicking the Change Icon button in the WelcomeApplet Properties dialog box. Figure 8.11 The Create Shortcut wizard helps to create a windows shortcut. 91

Figure 8.12 Select an appropriate name for the shortcut. Figure 8.13 The WelcomeApplet shortcut is created on the Windows desktop. 92

Figure 8.14 Select an appropriate name for the shortcut. 93