I think I have bad installation
I recently downloaded the sdk for my computer. The problem is my first program won't work so I'm convinced it is a bad download for whatever reason.I am running the well known program "Hello World".
At the end of my path I have C:\j2sdk1.4.2_05\bin which has to be right because when I compile it it shows no errors. Then I try to execute the program by inputing java -classpath. This is when my computer specifies that java.exe has had an error by showing the error message pop up(seperate from the command prompt) and saying that it needs to close. I'm sure most of you are familiar with this. I just wanted to know what should I do. If I download it agian do I have to delete the old one since I will have one path for two programs? And can I even think about deleting it all since it it has so many programs and applications on my computer.What should I do?
Change to the directory that contains HelloWorld.class. Then execute this command:
"C:\j2sdk1.4.2_05\bin\java -cp . HelloWorld"
Be sure that the command includes the period and the spaces around it.
If that works check the directories listed in the classpath (from left to right) for one that contains a copy of java.exe that isn't part of this version of Java. If you don't find one, then check the Registry (search for Javasoft) for an entry that's pointing to something not a part of this Java version.
I went to the this site and clicked "J2SE 1.4.2 SDK" under the popular downloads section on the right.I then clicked on "J2SE v 1.4.2_05 SDK " under the netbeans download. After downloading it into my hard drive I typed in this program
public class Hello
{
public static void main (String[] args)
{
System.out.println("Hello World");
}
}
After doing this I compiled it and tried to use java.exe by typing in java -classpath in the command prompt but got an error from the computer saying
" java.exe has encountered a problem and needs to close. We are sorry for the inconvenience."
This was seperate from the command prompt so I'm guessing there is a problem with the way my computer is interacting with the downloaded java software. My path is right because it compiled without any errors.How should I fix java.exe.?