PDA

View Full Version : jre1.5.0_08 Compiler


GSimpson
09-19-2006, 12:03 PM
So recently I started to learn java and I downloaded the latest Development kit but the tutorial is completly different when compiling and I can't find a tutorial to compile using the latest thing. jre1.5.0_08. Can someone help me?

Aradon
09-19-2006, 12:27 PM
So recently I started to learn java and I downloaded the latest Development kit but the tutorial is completly different when compiling and I can't find a tutorial to compile using the latest thing. jre1.5.0_08. Can someone help me?

You need the JDK not the JRE. get the jdk1.5.0_08 and install it. I forget exactly if Java puts it's compile in the path for you, but if it doesn't then you need to put the bin folder of where you placed your java into your path so that you can compile with javac.

So steps

1) Download JDK
2) Install JDK
3) Check to see if you can compile a java program with javac program-name.java
3.1) If not, set the path to the java installation bin directory
4) Compiler should be up and running

GSimpson
09-20-2006, 06:33 AM
So It turns out I had an old version of JDK but i downloaded the latest one.

So i'm compiling .class files now, so my next problem is I have a .java file with this code:


public class MyProgram {

public static void main(String[] args) {
System.out.println(
"Eureka, I can put Java on my resume.");
}
}


and I compile it to a .class and it doesn't work. Can you help me?

_Aerospace_Eng_
09-20-2006, 06:41 AM
What are you using to compile the files? Did you save it as MyProgram.java? How are you running them? And why didn't you post this in the progamming section?

Aradon
09-20-2006, 08:42 AM
It should be


javac filename.java


which will output filename.class

One you have that you just have to do


java filename


Notice how there is no .class there. As long as the compiler creates these class files you should be able to run it through there.

Remember you can check version of your java by doing


java -version


Just to double check