Software Installation for CS121

Similar documents
WA1884 Introduction to Java. using Oracle JDeveloper 11g. Classroom Setup Guide. Web Age Solutions Inc. Copyright Web Age Solutions Inc.

Setting up your Computer

Javac and Eclipse tutorial

CS520 Setting Up the Programming Environment for Windows Suresh Kalathur. For Windows users, download the Java8 SDK as shown below.

Pace University. Fundamental Concepts of CS121 1

WA1958 Mobile Software Design Patterns and Architecture Android Edition. Classroom Setup Guide. Web Age Solutions Inc.

2 Getting Started. Getting Started (v1.8.6) 3/5/2007

WA1739 Oracle WebLogic Server 10.3 Performance Tuning. Classroom Setup Guide. Web Age Solutions Inc. Copyright 2009 Web Age Solutions Inc.

WA2442 Introduction to JavaScript. Classroom Setup Guide. Web Age Solutions Inc. Copyright Web Age Solutions Inc. 1

WA2423 JavaScript for Web 2.0 Development. Classroom Setup Guide. Web Age Solutions Inc. Copyright Web Age Solutions Inc. 1

WA1677 J2EE Application Development with Spring and Hibernate. Classroom Setup Guide. Web Age Solutions Inc.

WA1278 Introduction to Java using Eclipse. Classroom Setup Guide. Web Age Solutions Inc. Copyright Web Age Solutions Inc. 1

WA2452 Node.js Software Development. Classroom Setup Guide. Web Age Solutions Inc.

WA EJB and JPA Programming with Java EE 6 - WebLogic 12 / Eclipse. Classroom Setup Guide. Web Age Solutions Inc.

CSCI 161: Introduction to Programming I Lab 1b: Hello, World (Eclipse, Java)

WA2185 Platform Independent Mobile Development with jquery Mobile and Apache Cordova. Classroom Setup Guide. Web Age Solutions Inc.

WA2056 Building HTML5 Based Mobile Web Sites. Classroom Setup Guide. Web Age Solutions Inc. Copyright Web Age Solutions Inc. 1

WA2445 Programming REST Web Services with JAX-RS Wildfly / JBoss Developer Studio. Classroom Setup Guide. Web Age Solutions Inc.

WA2493 What's New in Java 8. Classroom Setup Guide. Web Age Solutions Inc.

Life Without NetBeans

Getting Started (1.8.7) 9/2/2009

Certified Core Java Developer VS-1036

WA2009 Java EE 6 Programming - WebLogic 12c - Eclipse. Classroom Setup Guide. Web Age Solutions Inc. Copyright Web Age Solutions Inc.

WA2488 JavaScript Changes with ECMAScript Classroom Setup Guide. Web Age Solutions Inc.

WA2387 Hands-On soapui - Classroom Setup Guide. WA2387 Hands-On soapui. Classroom Setup Guide. Web Age Solutions Inc.

WA1827 Cloud Programming Workshop. Classroom Setup Guide. Web Age Solutions Inc. Copyright Web Age Solutions Inc. 1

WA2217 Programming Java EE 6 SOAP Web Services with JAX-WS - JBoss-Eclipse. Classroom Setup Guide. Web Age Solutions Inc.

WA2214 Mastering JAX-RS REST Web Services and AJAX Clients - JBoss / Eclipse. Classroom Setup Guide. Web Age Solutions Inc.

WA2012 Programming Java SOAP and REST Web Services - JBoss-Eclipse. Classroom Setup Guide. Web Age Solutions Inc. Copyright Web Age Solutions Inc.

WA day Java prereq for Selenium. Classroom Setup Guide. Web Age Solutions Inc. Copyright Web Age Solutions Inc. 1

WA2535 Apache Cordova From the Ground Up. Classroom Setup Guide. Web Age Solutions Inc.

Lecture 1: Overview of Java

Do this by creating on the m: drive (Accessed via start menu link Computer [The m: drive has your login id as name]) the subdirectory CI101.

Running Java Programs

WA1927 Introduction to Struts 2.x Using Eclipse. Classroom Setup Guide. Web Age Solutions Inc. Copyright Web Age Solutions Inc.

Eclipse Environment Setup

UNic Eclipse Mini Tutorial (Updated 06/09/2012) Prepared by Harald Gjermundrod

WA2579 Technical Introduction to Microservices. Classroom Setup Guide. Web Age Solutions Inc.

CSC116: Introduction to Computing - Java

Download and Installation Instructions. Java JDK Software for Windows

WA2271 Continuous Integration with Jenkins-CI. Classroom Setup Guide. Web Age Solutions Inc.

You should now start on Chapter 4. Chapter 4 introduces the following concepts

CSC116: Introduction to Computing - Java

WA2321 Continuous Integration with Apache Maven Jenkins-CI and Nexus. Classroom Setup Guide. Web Age Solutions Inc. Web Age Solutions Inc.

Pace University. Web Service Workshop Lab Manual

WA2451 DevOps Fundamentals. Classroom Setup Guide. Web Age Solutions Inc.

CS 152: Data Structures with Java Hello World with the IntelliJ IDE

Building Java Programs. Introduction to Programming and Simple Java Programs

Programming Principles 1 (CSC131) & 2 (CSC132) Software usage guide

Department of Computer Science. Software Usage Guide. CSC132 Programming Principles 2. By Andreas Grondoudis

3. Hello World! for IDEA. Java. Summer 2008 Instructor: Dr. Masoud Yaghini

RTMS - Software Setup

Windows Me Navigating

Even though we created a folder for the workspace, we still have to let JCreator do the same. So click File, New, and then Blank Workspace.

Notepad++ The COMPSCI 101 Text Editor for Windows. What is a text editor? Install Python 3. Installing Notepad++

Chapter 2 Author Notes

CPS109 Lab 1. i. To become familiar with the Ryerson Computer Science laboratory environment.

1. Go to the URL Click on JDK download option

Standard Edition (SE) application development Enterprise Edition (EE) enterprise development Micro Edition (ME) Internet of Things (IoT) development

CS 209 Section 52 Lab 1-A: Getting Started with NetBeans Instructor: J.G. Neal Objectives: Lab Instructions: Log in Create folder CS209

16.410: Jump Starting With Java

You will need to download the Java software development kit from

Getting Started with Eclipse/Java

JPA - INSTALLATION. Java version "1.7.0_60" Java TM SE Run Time Environment build b19

WA2684 Developing MicroServices. Classroom Setup Guide. Web Age Solutions Inc.

Creating Android Apps from Rh10

WA2621 DevOps Foundations for Java with Git, Jenkins, and Maven. Classroom Setup Guide. Web Age Solutions Inc. Web Age Solutions Inc.

Slide 1 CS 170 Java Programming 1 Duration: 00:00:49 Advance mode: Auto

Chapter 2. Editing And Compiling

Standard Edition (SE) application development Enterprise Edition (EE) enterprise development Micro Edition (ME) Internet of Things (IoT) development

Simulation Data Management. EDMopenSimDM. System Installation Guide (R13.0)

Lec 3. Compilers, Debugging, Hello World, and Variables

CSC116: Introduction to Computing - Java

Before you start working with Java, you need to set up a Java development

Software Installation Guide

Series 40 6th Edition SDK, Feature Pack 1 Installation Guide

CSIS10A Installation Instructions for setting up the BlueJ Java IDE

JVM interprets the Java bytecode, controls how it interacts with the operating system and manages memory.

CSE 421 Course Overview and Introduction to Java

Purpose. Why use Java? Installing the Software. Java

AP Computer Science Summer Assignment (updated 5/29/2018) DUE : Sept. 4, 2018

HT Remote Management System User Manual

Dspace 5.1. Installation on Windows 7 (32 bit system)

Web Age Solutions Inc. WA2639 Devops with Jenkins, Terraform and Hashicorp Stack. Classroom Setup Guide. Web Age Solutions Inc. 1

CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 2: SEP. 8TH INSTRUCTOR: JIAYIN WANG

3 CREATING YOUR FIRST JAVA APPLICATION (USING WINDOWS)

Java TM SE 7 Release Notes Microsoft Windows Installation (32-bit)

Lesson 04: Our First Java Program (W01D4

Getting Started with Java. Atul Prakash

Android Studio Setup Procedure

Batch Watermark Creator Software

Mehran Sahami Handout #5 CS 106A September 26, 2018 Downloading Eclipse

IT Essentials v6.0 Windows 10 Software Labs

Eclipse Tutorial. For Introduction to Java Programming By Y. Daniel Liang

Sun ONE Integrated Development Environment

NetBeans IDE Java Quick Start Tutorial

UOB Offline Data Input Software (ODIS)

Getting Started with Eclipse for Java

Java Programming Language Mr.Rungrote Phonkam

5/3/2006. Today! HelloWorld in BlueJ. HelloWorld in BlueJ, Cont. HelloWorld in BlueJ, Cont. HelloWorld in BlueJ, Cont. HelloWorld in BlueJ, Cont.

Transcription:

Software Installation for CS121 Dr. Lixin Tao http://csis.pace.edu/~lixin Computer Science Department Pace University August 26, 2005 1 Installation of Java J2SE 5 SDK 1. Visit Start Settings Control Panel Add/Remove Programs to remove any of existing installations of Java SDK or JRE (Java runtime environment). Make sure you reboot the system before you install any new software. After rebooting, delete the installation directories for those removed installations. Let a PC have multiple Java installations may lead to confusion. 2. Visit http://java.sun.com/j2se/1.5.0/download.jsp with a Web browser. Click on hyperlink Download JDK 5.0 Update 4 to get to the J2SE 5 SDK download page. Check the checkbox for accepting license agreement. In the section for Windows Platform J2SE (TM) Development Kit 5.0 Update 4 section, click on the hyperlink Windows Offline Installation, Multi-language to download the installation file jdk-1_5_04-windowsi586-p.exe to your PC. The file has 56.71 MB. 3. In a Windows Explorer, click on the downloaded file jdk-1_5_04-windows-i586-p.exe to start its installation. Accept the license agreement, and take all default values. By default, your J2SE 5 installation directory will be C:\Program Files\Java\jdk1.5.0_04. The installation of J2SE 5 will take about 120 MB of disk space. You only need the installation of JDK 1.5, which includes JRE (Java Runtime Environment) 1.5. After the JDK 1.5 is installed, you will be prompt for installing an external version of JRE, and you can just cancel it. 4. To run Java compiler javac and interpreter java on the command-line, you need to add the bin directory of your J2SE 5 on the environment variable PATH. An environment variable is a memory location where the operating system keeps some values for programs to access. When you type a command javac and then ENTER in a Command Prompt window, for example, the operating system will try to find whether there is an executable file named javac.exe, java.bat, or javac.com on your PATH. The value of PATH is a sequence of directories separated by semicolon ; in DOS and colon : in Unix/Linux. Period (.) is used to represent the current working directory (the directory in which the command jacac is typed). The operating system will sequentially try to find an executable file for javac in the directories on the PATH, from left to right. The first executable file with file stem name javac will be executed. If the operating system completed the search in all directories on the PATH and none of the executable files for javac could be found, the operating system will declare that `javac is not recognized as an internal or external command, operable program or batch file. Right-click on My Computer and choose Properties from the popup menu. In the System Properties window, click on the Advanced tab. Click on the Environment 1

Variables button. In the bottom System variables area of the Environment Variables pane, click on button New to launch the New System Variable pane. Enter value JAVA_HOME for variable name, and value C:\Program Files\Java\jdk1.5.0_04 for Variable value, as shown below. (If you use a Java SDK installation at another directory, you should update the variable value accordingly.) Click on the OK button to compete the definition. Now click to highlight the line for Path in the System variables area, and then click on the Edit button. In the Variable value textbox, move the cursor to the left end, and insert %JAVA_HOME%\bin; at the beginning, as shown below. Here %JAVA_HOME% is to be replaced with the current value of environment variable JAVA_HOME by the operating system. Click on the OK button to complete the modification. 5. Now you also need to set up the value of environment variable CLASSPATH, which is used by java and javac to find needed Java classes. When you type java Hello, the command java.exe will follow the value of environment variable CLASSPATH, from left to right, to search for the first file Hello.class to execute. The value of CLASSPATH is a sequence of directories for storing Java class files. Period (.) represents the current directory in which you typed java Hello. If there are multiple instances of file Hello.class in different directories on the CLASSPATH, only the first one will be executed. If there is no file Hello.class in any of the directories on the CLASSPATH, command java will declare that Exception in thread "main" java.lang.noclassdeffounderror: Hello. In Windows Explorer, create a new directory C:\classes. This will be the directory where we keep all Java class files. In the bottom System variables area of the Environment Variables pane, click on button New to launch the New System 2

Variable pane. Enter value CLASSPATH for variable name, and value.;c:\classes for Variable value, as shown below. The value of CLASSPATH is a list of semicolonseparated directories. The first period (.) represents the current directory. Click on the OK button to compete the definition. Click on the OK button of the Environment Variables pane to shut it down. Click on the OK button of the System Properties window to shut it down. 6. To test whether you have done correctly, click on Start Run, type cmd in the Open box, and click on the OK button to start a Command Prompt window. Type javac and the ENTER key in the window. If you see usage information of javac, you have completed this step successfully. Otherwise you need to carefully redo this step. 2 Customizing Properties of Windows Explorer For software developers, Windows Explorer should show detailed view of files, and file extensions of known types should be displayed all the time. This section introduces some useful customizations to your Windows Explorer for better supporting Java programming. 1. Click on Start All Programs Accessories Windows Explorer to launch an instance of Windows Explorer. 2. Click on View Details to turn on the detailed view. In the right pane, each file or directory will be represented by a line specifying its name, size, type, and date modified. 3. Click on Tools Folder Options to launch the Folder Options pane. In the Folders Options pane, click on tab View. Make sure that you have checked on options Display the full path in the address bar, and unchecked options Hide extensions for known file types and Remember each folder s view settings, as shown in the following screen capture: 3

Click on button Apply to All Folders so all Window Explorer instances will have the same folder options as this one. 4. Click on tab File Types. In the Registered file types list, click on the line for (NONE) Folder, as shown below: 4

5. Click on the Advanced button to launch the Edit File Type window. Click on the New button in the Edit File Type window to launch the following New Action window. In this New Action window, type Command Prompt in the Action field, and cmd.exe %1 in the Application used to perform action field, as shown below: 6. Click on the OK button to shut down the New Action window. Click OK button again to shut down the Edit File Type window. Click on OK button again to shut down the Folder Options window. 7. From now on, if you need to open a Command Prompt window in a directory shown as a folder in the left pane of the Windows Explorer, you just need to right-click on that folder in the left pane of Windows Explorer, and then click on the Command Prompt item in the popup menu. The following example shows how I opened a Command Prompt window in C:\cs389\inheritance. and a new instance of Command Prompt window popped up as below: 5

3 Installation of EditPad Visit http://www.editpadpro.com/editpadlite.html to download and install the free Editpad Lite text editor. 4 EditPad: Customizing Tab Size and Replacing Tab with Spaces Start EditPad. Click on Options Preferences Click on File Types in the new Preferences window. In the left upper scroll pane, scroll and choose Java source code. In the lower right side of the window, set Tab size to 2, Block indent to 2, and check the checkbox for Pressing Tab inserts spaces instead of tab characters. Then click on the bottom Apply button. 5 Typical Process for Creating and Running a Java Program 1. Use a text editor, like EditPad, to create a Java source file which must have a file extension of.java. For example, you could create a new Java source file C:\cs121\Hello.java that has contents as follows: 6

public class Hello { public static void main(string[] args) { System.out.println("Hello, World!"); } } 2. Open a Command Prompt window and change directory to C:\cs121 (see the next section for some tutorial on using DOS commands). If you have followed my customization of the Windows Explorer, you could achieve this by right-clicking on folder C:\cs121 in the left pane of a Window Explorer, and then click on the Command Prompt item of the popup menu. 3. In the Command Prompt window, type javac -d C:\classes Hello.java to compile the source file Hello.java into a Java class file Hello.class in folder C:\classes. The command-line switch -d of javac command is used to specify the destination of the class files as a result of the compilation. Learn to use switch -d will save your time when you need to declare Java classes in Java packages, as we will explain during the class. 4. In any Command Prompt window, type java Hello to run file Hello.class. Since file Hello.class is in C:\classes and the latter is on our CLASSPATH, the java command can find it and run it. The following is the screen capture of my session of running the above steps 2 and 3. 6 A Basic Tutorial on DOS Commands 7

If you are serious in a programming career or using Unix/Linux, some experience in commandline operation is necessary. To start a Command Prompt window, you can either use Start Run and then run cmd, or click on Start All Programs Accessories Command Prompt. If you have customized your Window Explorer as I explained earlier, you can also right-click on a directory in the left pane of a Window Explorer and then click on the Command Prompt item of the popup menu, which will lead you directly to the directory for working on. You can change your working directory by using changing directory (cd) command, as in the following examples: To work on drive C: (suppose you are not on drive C: now), type C: and ENTER. To move up to the top level of your drive C:, type cd \ and ENTER. Suppose you are now at C:\. To change directory to C:\cs121, type cd cs121. To move up working directory by one level, type cd.. To create a new directory named src in the current directory, type md src. Here md means Make Directory. To delete a directory named src, you first need to make sure that directory src is empty. Then you type rd src. Here rd means Remove Directory. To delete a file Hello.class in the current directory, type del Hello.class. To delete all Java class files in the current directory, type del *.class. Normally, Windows Explorer is easier for creating/renaming/deleting directories and files. To duplicate a Command Prompt window, type start and ENTER in the current Command Prompt window. To check the definitions of the environment variables on your PC, type set and ENTER. To check the definition of environment variable PATH, just type path and ENTER. To temporarily change the definition of environment variable CLASSPATH to.;a:\classes, type set CLASSPATH=.;A:\classes. This change of value for CLASSPATH will only have effect in this current Command Prompt window. This could be useful if you want to put your floppy disk s directory classes on the CLASSPATH. If you need to type a long name of a file in the current directory, you can type its initial letters and then type TAB for auto-completion. For example, for compiling the Hello.java file in my previous screen capture, I could have typed javac d C:\classes H and then TAB, the command will automatically completed as javac d C:\classes Hello.java. 7 A Note for Storing Programs on Lab PCs 8

During lectures and lab sessions we will use lab PCs to work on Java programs. Your files can be stored on drive C: for better performance. But the files on lab PCs will not survive PC reboot. It is highly recommended that you copy your source files and folder classes from your floppy disk or USB memory stick to the drive C: of your working lab PC at the start of a lab session, work through the lab session on the drive C: of your working lab PC, and copy your C:\classes and other new source files created during the lab session to your floppy disk or memory stick for keeping them and porting them back to your home PC. 9