How to run a j2se program

I have downloaded all items I was told to download and I wrote a program in the notepad but how do I run that program?
[125 byte] By [techn0l0gya] at [2007-10-1 23:02:32]
# 1

java -cp [classpath] [class file]

Classpath needs to include all JAR files (and CLASS files) that will be needed by the program to run.

Class file specifies the name of the Java class with a main() method that you wish to execute.

http://www.google.com/url?sa=t&ct=res&cd=4&url=http%3A//www.redbrick.dcu.ie/help/reference/JDK.1.1.8-docs/tooldocs/win32/java.html&ei=4-weQ5jCLMu-iwHSjryXDA

- Saish

Saisha at 2007-7-15 13:59:06 > top of Java-index,Administration Tools,Sun Connection...
# 2
Okay I'm still confused (sorry about this, Im new to java)Can you explain the steps to get to that? I heard that you have to go to start and then run but what do you type in run to get the box to pop up?
techn0l0gya at 2007-7-15 13:59:06 > top of Java-index,Administration Tools,Sun Connection...
# 3

> I have downloaded all items I was told to download

> and I wrote a program in the notepad but how do I run

> that program?

What is the name of the program you wrote? It should end in .java and match the name of the class you defined within the file. Let's say you created a class Foo saved in a file Foo.java.

[code]

class Foo {

static final public void main(final String[] args) {

System.out.println("Hello world");

}

[code]

You would have to compile your file with javac. You would then execute the CLASS file it using java.exe or java (Unix executable).

I recommend you follow the tutorial here: http://java.sun.com/docs/books/tutorial/getStarted/cupojava/index.html to get started.

- Saish

Saisha at 2007-7-15 13:59:06 > top of Java-index,Administration Tools,Sun Connection...
# 4

Sorry, messed up the formatting tags:

class Foo {

static final public void main(final String[] args) {

System.out.println("Hello world");

}

}

- Saish

Saisha at 2007-7-15 13:59:06 > top of Java-index,Administration Tools,Sun Connection...