hey guys, I am tying to set up the java compiler on a new computer, I downloaded the jdk and the compiler works, but it only works when I'm in C:\Program Files\Java\jdk1.5.0\bin. Is there a way to make it so that both the compiler and the jvm work in any folder on the computer? or at least a different specifed folder? -Thanks Dan
How the PATH is set depends on your operating system. So, what are you running?
Note that the steps to set most any operating system environment variable for a particular operating system are about the same. So, you be able to figure it out by taking a look at HowToSetTheClasspath for the steps to take.
Excuse me for the confusion,I was referring to the same above thread topic. I'am trying to run the java source files from c:> ,for this I have set the path to c:>j2sdk1.4.2_04\bin\javaexamples I have my source files in javaexamples folder. Even though the files don't get executed.It gives an error message as Error: Cannot read A.java
You should only add the path to the executable files (javac.exe, java.exe and so on) found in c:>j2sdk1.4.2_04\bin to the PATH. This is to help your OS find the commands you want to use. When this is done you should be able to compile and run your java-files in any folder on your computer.
If you are having trouble compiling (javac ...), you need to set your PATH. If you are having trouble running the compiled classes, you need to set your CLASSPATH. I can't see from your question which you are having problems with.
JavaBeginnersFaq "Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
kiran vydhyam Error: Cannot read A.java, right? I used to have a similar problem. I think the editor you are working on is adding it's own extension to your java file. For example when you save you have something like: A.java.txt right? This time, when you save, include " ". For example, "A.java" That should allow javac to read A Maybe to hide extensions for known file types may be permanent.