A Java Crib Sheet. First: Find the Command Line



Similar documents
Online Chapter B. Running Programs

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

Accessing your Staff (N and O drive) files from off campus

Supplement I.B: Installing and Configuring JDK 1.6

FREE VERSION. Created by: Jason Nesbitt Mobile App Development Guide

Installing the Android SDK

Installing Java. Table of contents

How to use Dropbox. What is Dropbox. Please read the University of Melbourne Guidelines on Dropbox and University Information prior to use.

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

Accessing SSL VPN with Mac OS X

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

Supplement I.B: Installing and Configuring JDK 1.6

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

Download and Installation Instructions. Java JDK Software for Windows

Jenkins on Windows with StreamBase

Lab 0 (Setting up your Development Environment) Week 1

Software Development Environment. Installation Guide

INSTALLING MALTED 3.0 IN LINUX MALTED: INSTALLING THE SYSTEM IN LINUX. Installing Malted 3.0 in LINUX

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

Configuring the BBj Jetty Web Server (rev10.02) for OSAS

Signiant Agent installation

Packaging and Deploying Java Projects in Forte

Digital Workflow How to make & use digital signatures

Installing Ruby on Windows XP

SuperOffice AS. CRM Online. Installing the Citrix Online Web plug-in

The Citrix service is now available to faculty and staff at Cypress College.

MY WORLD GIS. Installation Instructions

User guide. Business

How to register and use our Chat System

How to Create and Send a Froogle Data Feed

Backing up FRS: Method 1 Only Files Needed

Server & Workstation Installation of Client Profiles for Windows

Generate Android App

Installing IDEA v8 Client Software on Citrix Server Environment

Citrix for Mac Installation

IT Quick Reference Guides Installing Office 365 from Kivuto Solutions

Getting Started Guide - Desktop

Using Virtual Machines

How To Import Credit Card Charges Into Concur

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

Microsoft Security Essentials Installation and Configuration Guide

Managing Documents in the Citrix XenApp Remote Desktop

Mariemont City Schools

Installing (1.8.7) 9/2/ Installing jgrasp

Group Policy Objects: What are They and How Can They Help Your Firm?

Appendix A Using the Java Compiler

STEP 01 Nortel Contivity VPN Client Installation

The Social Accelerator Setup Guide

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

Working Together - Your Apple Mac and Microsoft Windows

Cleaning your Windows 7, Windows XP and Macintosh OSX Computers

How to Setup and Connect to an FTP Server Using FileZilla. Part I: Setting up the server

Maintaining your company file

Java Programming Unit 1. Your first Java Program Eclipse IDE

The IDL Virtual Machine

Using Remote Desktop to access your Office Computer or Faculty Remote Desktop Server August, 2005 This document consists of two main parts and an

Using Karel with Eclipse

How to connect to the University of Exeter VPN service

Android: Setup Hello, World: Android Edition. due by noon ET on Wed 2/22. Ingredients.

NETWORK SET UP GUIDE FOR

How to install Radiance on your computer via a virtual machine

A Crash Course in OS X D. Riley and M. Allen

NSave Table of Contents

TIME MACHINE. the easy way to back up your computer

Internet Address: cloud.ndcl.org

CONNECT-TO-CHOP USER GUIDE

Team Foundation Server 2013 Installation Guide

How to Access UF Health Jacksonville VPN services

MSH OnsiteHealth is a Web site for Physicians - providing system access off campus. MSH OnsiteHealth is a free, secure Web site featuring:

SSL VPN Service. Once you have installed the AnyConnect Secure Mobility Client, this document is available by clicking on the Help icon on the client.

How to make a VPN connection to our servers from Windows 8

Quick Start Guide. SYSTEM REQUIREMENTS Mac OS X Mavericks 64-bit processor A Mac with an Intel processor 1GB of memory 64MB of free space

ACCESSING CERNER ON A MAC (October 1, 2012)

Samsung Xchange for Mac User Guide. Winter 2013 v2.3

The Windows Command Prompt: Simpler and More Useful Than You Think

Installing the Virtual Desktop Application (MAC)

Setting Up Your Android Development Environment. For Mac OS X (10.6.8) v1.0. By GoNorthWest. 3 April 2012

Clickfree The Effortless Backup Solution

How to Install the Cisco AnyConnect VPN Client. Installing Cisco AnyConnect VPN Client on Windows with the Chrome Browser (Recommended)

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

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


SOS Suite Installation Guide

9/11/15. What is Programming? CSCI 209: Software Development. Discussion: What Is Good Software? Characteristics of Good Software?

HADS 2.1.0e Installation and migration

Eclipse installation, configuration and operation

DECS DER APPLE WIRELESS HELPER DOCUMENT

Macintosh General Help

CEFNS Web Hosting a Guide for CS212

How to get MOSS 2007 dev. environment set up in Vista with sample project.

Server & Workstation Installation of Client Profiles for Windows (WAN Edition)

Getting FileMaker Server 11 and IIS 7.x to Work with SSL. By Todd Duell

Using TS-ACCESS for Remote Desktop Access

NJCU WEBSITE TRAINING MANUAL

Portal Instructions for Mac

Netbeans IDE Tutorial for using the Weka API

`````````````````SIRE QUICK START GUIDE

DropSend Getting Started Guide

Creating your personal website. Installing necessary programs Creating a website Publishing a website

Encryption Guide version 1.2, by Thomas Reed

Transcription:

A Java Crib Sheet Unlike JavaScript, which is pretty much ready-to-go on any computer with a modern Web browser, Java might be a more complex affair However, logging some time with Java can be fairly valuable, if only to experience the typical programming cycle of code-compile-execute This handout hopes to hit the salient points involved with getting Java up and running on your machine; as always, individual variations may emerge, so never hesitate to ask if something unexpected comes up First: Find the Command Line We will be working from a command line interface, so the first order of business is to find it on the computer that you ll be using for Java On Windows, the quickest way to the command line is to choose Run from the Start menu then enter cmd as the program to run On Mac OS X, you get to the command line through the Terminal application, which can be found in the Utilities folder inside the Applications folder

Command Line Basics To invoke a command, type it into the command line window then press the Enter or Return key; the computer then displays some response to that command (which may or may not make sense to you) To get out of the command line in both Windows and Mac OS X, type exit and press Enter or Return On Mac OS X, the Terminal program remains running, in case you want to open a new command window; you ll need to Quit as well if you re sure you won t need another command window anytime soon Check for Java At the command line, enter javac (the Java compiler); if the Java development kit is properly installed on your machine, you should see a long-ish message describing how to use the javac program If you don t get this message, then you ll need to install the Java Development Kit (JDK); if you re sure you ve already installed it, you may need to contact me at this point so we can figure out what went wrong Mac OS X typically comes with JDK out-of-the-box; it s Windows that might not have it preinstalled

Downloading and Installing Java If you conclude that you do need to download and install Java, you can find it here: http://java.sun.com/javase/downloads Notice that there is no Mac OS X JDK download as mentioned, modern Macs all have JDK preinstalled (so if you re using Mac OS X and are having trouble invoking javac, let me know) Make sure to download the latest JDK, not JRE (this is a smaller version of Java that is meant for end-users instead of programmers) Let s Work on the Desktop You can really work anywhere on your computer s disk drive, but for convenience and visibility, let s work on your account s desktop On Windows, enter cd Desktop if the command line prompt says C:\Documents and Settings\your-username; if not, enter C: first, then cd \Documents and Settings\yourusername\Desktop On Mac OS X, enter cd ~/Desktop to get there The nice thing about working on your desktop is that you ll immediately see the files that you create as icons

Create Your Java Source File As with XHTML, Java source files are simply plain text files so they can be created with the likes of Windows Notepad or Mac OS X TextEdit Type up the code, then save it onto your desktop Java source files follow a strict naming system: they should bear the name of the class that is in the source (you ll find it in public class name-of-class, a few lines from the top) and must end with.java Again, you can really save the file anywhere, but we re just using the desktop for convenience Compile Your Program We ll use the command line to compile your program In case you re wondering, yes, there are development tools that have more modern user interfaces still, in the end, it boils down to invoking a compiler Go to your computer s desktop on the command line (see above), then enter javac name-of-file.java If all goes well, javac will simply finish as if nothing happened but you should see something new: a file called name-of-file.class this is the translated code

If Problems Arise Don t feel bad if javac does complain it happens to everyone, including professional programmers The first thing to check is to make sure that you typed in your program exactly as provided; the error message(s) provided by javac should give you a hint as to where something went wrong If you can t get javac to compile your file properly, just contact me the problem is usually easy to fix, but only for someone who writes code for a living :) Run Your Program Once your class file is successfully created (i.e., you have a name-of-file.class file on your desktop), you can invoke it through java (without the c) Enter java name-of-file options (no extensions this time no.java nor.class); options includes any information that you would like to provide to the Java program If all goes well, the program should do its work and show you some kind of a response Note that errors may happen at this stage too when in doubt, ask me

Have Fun! Remember, the point of this exercise isn t really to learn parts of Java as a language; it s mainly to get a feel for how compiled programming goes Never, never hesitate to ask this may be your first time out, so there are sure to be glitches