How to Run Java Programs Using Microsoft J++



Similar documents
Configuring Your Firewall for Client Access in Professional Edition

WordCom, Inc. Secure File Transfer Web Application

DEPLOYING A VISUAL BASIC.NET APPLICATION

1. After installing you can launch the program by clicking on the Start button and then select Programs, then WS_FTP LE, and then WS_FTP LE.

Basics. a. Click the arrow to the right of the Options button, and then click Bcc.

Microsoft Visual Studio 2010 Instructions For C Programs

The Application Getting Started Screen is display when the Recruiting Matrix 2008 Application is Started.

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

Junk Settings. Options

Releasing blocked in Data Security

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

Open a PDF document using Adobe Reader, then click on the Tools menu on the upper left hand corner.

Moving the TRITON Reporting Databases

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

Microsoft Access Database

Introduction to the use of the environment of Microsoft Visual Studio 2008

Lab: Create Your Own Homepage! This exercise uses MS Expression Web as a Web Page creation tool. If you like you

Creating a Java application using Perfect Developer and the Java Develo...

Create!form Folder Monitor. Technical Note April 1, 2008

What is a Mail Merge?

Overview... 2 How to Add New Documents... 3 Adding a Note / SMS or Phone Message... 3 Adding a New Letter How to Create Letter Templates...

Instructions for Configuring a SAS Metadata Server for Use with JMP Clinical

Moving the Web Security Log Database

Creating Web Services Applications with IntelliJ IDEA

Vodafone PC SMS (Software version 4.7.1) User Manual

Word 2010: Mail Merge to with Attachments

Windows XP Managing Your Files

You must have at least Editor access to your own mail database to run archiving.

How To Restore Your Data On A Backup By Mozy (Windows) On A Pc Or Macbook Or Macintosh (Windows 2) On Your Computer Or Mac) On An Pc Or Ipad (Windows 3) On Pc Or Pc Or Micro

What is OneDrive for Business at University of Greenwich? Accessing OneDrive from Office 365

Microsoft Excel 2013: Using a Data Entry Form

Fax-to- Application User Guide

Using ProjectWise Explorer for File Transfer

Guide to PDF Publishing

Microsoft Access 2007 Advanced Queries

Tech Tips Helpful Tips for Pelco Products

Outlook Operating Instructions. Internal Desktop Access

MINIMIZING DISK SPACE USAGE IN SAAS OR VIRTUAL OFFICE CS

Promap V4 ActiveX MSI File

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

Creating a Simple Visual C++ Program

How to Back Up and Restore an ACT! Database Answer ID 19211

Presentations and PowerPoint

How to make a backup copy of a.pst file

The Reprographics Online E-Copy Process is used to submit print jobs to the RUSD Reprographics department.

TAMUS Terminal Server Setup BPP SQL/Alva

Adding a File Attachment to a CFS Requisition

Quick Start Guide. Highly customizable automated trading Automate your trades according to rules and models you create.

Checking Browser Settings, and Basic System Requirements for QuestionPoint

ECDL. European Computer Driving Licence. Database Software BCS ITQ Level 1. Syllabus Version 1.0

Richmond SupportDesk Web Reports Module For Richmond SupportDesk v6.72. User Guide

Lab: Data Backup and Recovery in Windows XP

Installation Guide - Client. Rev 1.5.0

Disabling Microsoft SharePoint in order to install the OneDrive for Business Client

Microsoft FrontPage 2003

Organizing and Managing

ProSystem fx Engagement

Instructions for Importing (migrating) Data

Internet Explorer Browser Clean-up

MAPPING THE WEBDRIVE REFERENCE GUIDE

Compiler Setup and DirectX/OpenGL Setup

Tool Tip. SyAM Management Utilities and Non-Admin Domain Users

Microsoft Office PowerPoint Identify components of the PowerPoint window. Tutorial 1 Creating a Presentation

Using SSH Secure Shell Client for FTP

PC Requirements and Technical Help. Q1. How do I clear the browser s cache?

Appendix K Introduction to Microsoft Visual C++ 6.0

ProjectWise Explorer V8i User Manual for Subconsultants & Team Members

Pocket ESA Network Server Installation

Create a New Database in Access 2010

Outlook: Storing

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

To successfully initialize Microsoft Outlook (Outlook) the first time, settings need to be verified.

HOW TO BURN A CD/DVD IN WINDOWS XP. Data Projects

Moving Rockwell Software Activation Keys to the VersaView 200R Industrial Computer

Microsoft Office 2010

Mail Chimp Basics. Glossary

Composite.Community.Newsletter - User Guide

How to Configure Microsoft System Operation Manager to Monitor Active Directory, Group Policy and Exchange Changes Using NetWrix Active Directory

Microsoft PowerPoint 2010

Virtual Communities Operations Manual

enter the administrator user name and password for that domain.

To begin, visit this URL:

Setting up Millennium on your Computer February 4, 2016

Context-sensitive Help Guide

Changes to Skillnet Group s. Outlook and Outlook Express Users

Guide to using Cumulus software (a.k.a., the Cumulus "client")

Lab - Data Backup and Recovery in Windows XP

Call Recorder Quick CD Access System

Introduction to Eclipse

Distributing SMS v2.0

STATISTICA VERSION 9 STATISTICA ENTERPRISE INSTALLATION INSTRUCTIONS FOR USE WITH TERMINAL SERVER

Appendix M: Introduction to Microsoft Visual C Express Edition

MyMathLab / MyStatLab Advanced Interactive Training Guide

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

Managed File Transfer Utility

Transitioning from TurningPoint 5 to TurningPoint Cloud - LMS 1

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

Transcription:

How to Run Java Programs Using Microsoft J++ C. Thomas Wu Supplement material to accompany An Introduction to Object-Oriented Programming with Java WCB/McGraw-Hill The McGraw-Hill Companies, Inc., 1999 In this document, we will explain how to run Java programs using Micrsoft J++ version 6.0. 1.0 Installing the Software and javabook Package Install Microsoft J++ on your machine following the instructions of the installation program. Also, download the javabook package and sample programs from the DrCaffeine web site (www.drcaffeine.com). Notice that the Java package is organized as a folder (directory), so you will see the javabook package as a folder that contains the javabook classes. The javabook folder also includes the source files so you can study them and have an option of modifying them. 2.0 Directory Structure You can place the javabook package and sample programs anywhere you want. However, in order to present concrete examples on how to run programs that use javabook classes, we will assume the following directory structure in this handout: I assume the D: drive. Replace it with the name of the drive you use. D: JavaProjects javabook SamplePrograms.. Ch1. Ch15 HomeWork1 The javabook classes are stored here. This directory is created automatically when you follow the instructions in this handout. 1 of 7

Starting J++ 3.0 Starting J++ Start J++ by selecting its program icon in the Start Program Microsoft Visual J++ 6.0 group (or whichever group the J++ icon is located). 4.0 Creating a Project J++ and other Java IDEs (Integrated Development Environment) use project-based concepts. A project consists of various types of files that are necessary for compiling and running programs. For the sample programs from the earlier chapters, the projects will include only one or two source files. In the later chapters, projects will include over 10 files. To create a project, select the menu choice File New Project. The Project Wizard dialog appears on the screen. In this dialog, a Windows application is selected as the basis for a new project. We do not use any of these predefined templates for our programs. Instead, we will create an empty project. Click the Visual J++ Project folder icon. The dialog will change to 2 of 7 How to Run Java Programs Using Microsoft J++

Specifying the CLASSPATH Property of the Project (Very IMPORTANT!) We enter the name of a new project in the Name field and place this project under the directory D:\JavaProjects. We will call this project Homework1. To set the location of the directory, you can click the Browse button and select the directory you want. You need to experiment here to see the various ways of setting the Name and Location fields. Before you continue, make sure the dialog looks as follows: When everything is set correctly, click the Open button. J++ IDE will create a new folder called HomeWork1 and place all files related to this project in this folder. You will notice a new project called HomeWork1 appearing in the Project Explorer window at the top righthand corner. Note: Depending on the option, the Project Explorer window can appear elsewhere. If you don t see the Project Explorer window, select the menu choice View Project Explorer. 5.0 Specifying the CLASSPATH Property of the Project (Very IMPORTANT!) Now that a new project is created, we need to set its CLASSPATH property so the javabook classes can be accessed from the project. Choose the menu choice How to Run Java Programs Using Microsoft J++ 3 of 7

Specifying the CLASSPATH Property of the Project (Very IMPORTANT!) Project HomeWork 1 Properties Note: If you named the project XYZ, then the menu text would be XYZ Properties. When you select this menu choice, the Properties dialog appears on the screen. Click the Classpath tab. Inside this tab, click the New button to add a new class path. Enter the classpath D:\JavaProjects. We specify this directory as a new class path because this directory contains the javabook package. Notice that a Java package is stored in a hard disk as a directory. The Properties dialog now looks as follows: Click the OK button to set this property and close the dialog. 4 of 7 How to Run Java Programs Using Microsoft J++

Creating a Class File (Source Code) 6.0 Creating a Class File (Source Code) We are now ready to add a class to the project. Let s create the FunTime program from Chapter 1. Choose the File New File menu choice. The New File dialog opens. Click the Visual J++ folder icon and then select the Java File icon in the right pane. The dialog looks as follows: Click the Open button. An editor window to enter the program appears. Type in the FunTime program from Chapter 1. After you entered the program, the window should look something like this: After the program is entered, chose the File Save As menu choice to save the program. (The actual text will read Save Java File1 As. In general, the text is Save XXX As with XXX replaced by the temporary name given by the IDE.) Save the file as Fun- Time.java. Make sure you enter the name using lower and uppercases correctly and adding the suffix java. How to Run Java Programs Using Microsoft J++ 5 of 7

Running a Java Application Program The Project window now looks like this: The save source file FunTime.java is added to the project HomeWork1. Notice the same file is added to a new entry called Miscellaneous Files. This portion will be gone when you compile the program correctly and close the editor window. NOTE: Instead of typing the program, you can add existing source files to the project. To run sample programs, for example, all you have to do is to copy the source files to the project. Let s say you want to test run the DrawShape program from Chapter 6. You can do so by copying the sample files from the Chapter 6 folder to the HomeWork1 folder. Files copies to the HomeWork1 folder will appear automatically in the Project Explorer window. If you do this, make sure you remove other files from the project. I suggest that you create a project called Sample and use this project to run sample programs. Everytime you want to run a new sample program, remove any files currently in the project and copy the source files for the sample program. Warning: If you remove a source file from a project, the file is also deleted from the project folder also. 7.0 Running a Java Application Program We are finally ready to run the program. Choose the menu choice Debug Start or click the VCR-like start toolbar icon: If there s no error in the program, the SketchPad window will appear on the screen. 6 of 7 How to Run Java Programs Using Microsoft J++

Quick Summary 8.0 Quick Summary Here s a quick summary of the steps you take to enter, compile, and run a Java program using J++. 1. Create a project. 2. Set the project s class path property to point to the javabook package. 3. Create a new java source file. Name the source file with the class name. Example: The class Funtime is saved in the file Funtime.java. 4. Run the program. 9.0 Running Applets Steps for compiling and executing applets are similar to those for applications. The main difference is that an applet requires an html file. The role of html files is explained in Chapter 2. In Step 3 of Quick Summary, you create a corresponding HTML file for the applet. Example: MyFirstApplet.java for the applet source file and MyFirstApplet.html for the corresponding HTML file. How to Run Java Programs Using Microsoft J++ 7 of 7