Principles of Computer Science II
Principles of Computer Science II
Principles of Computer Science II
Eclipse Installation
Overview
Sample Program and Submission
Instructions/Guidelines for Lab
Useful Links
JDK, JRE, JVM
Java
Environment
Setup
Click the "Download" button for the JDK.
Agree to the license and download the file for your operating system.
Run the install file and follow the prompts to install Java.
Windows Setup
Use programming text editor (TextPad, NotePad++) , enter below source code
public class Hello {
public static void main(String[] args) {
System.out.println("Hello, world!");
}
}
Save file as Hello.java, under your work directory (e.g., d:\myProject).
Click "Start" ⇒ "run..." ⇒ Enter "cmd".
(Change to Drive where source file is saved)
(Set current working directory)
To verify your installation, Open a Terminal (Finder -> Go -> Utilities -> Terminal)
Issue below commands
Use Text editor (Sublime Text, jEdit), enter "Hello World" program code
Save as "Hello.java" under the directory "~/myProject"
(Finder -> Go -> Home. Select File -> New Folder -> myProject)
Mac Setup: Compile & Run Sample JAVA program
Open a new "Terminal" (Go -> Utilities -> Terminal ) and issue below commands.
Eclipse
Click OK. Eclipse SDK window with a Package Explorer tab will be seen
Setting up Workspace Contd..
Q. Write a java program named SumThousand. The program add all the integers from 1 to
1000 together and print out the sum. (Note: this problem has been discussed in Monday’s
class).
Useful Links
JDK installation for Mac OS X:
http://docs.oracle.com/javase/7/docs/webnotes/install/m
ac/mac-jdk.html