Then we went began programming in Java
Setting up home computers
- First download and install the latest JDK (not JRE) for Java. 1.5.0_08 is the latest that I saw today.
- After installing the JDK, then download and install BlueJ
- Next Start BlueJ and create the project and class files below
Creating a Java program
- Start new project, called whatever you'd like
- Create new Class file, call it "First". Class names should always start with a capital letter.
- Erase all the text in class file, BlueJ writes some standard lines of code to help you get started. For now we will erase all unti you feel comfortable editing their code.
- Type in the following:
class First
{
public static void main(String [] args)
{
System.out.println("Hello CS160");
}
}
- Use the compile button to compile the program. If you have an error the compiler will let you know.
- Right click on the First icon in the project desktop and select the main method.
- Hit OK in the next window and the program should run.
- If you have troubles you can get help in the lab on Tuesday.
|