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.
I have done this,I have set the path as C:\j2sdk1.4.2_04\bin;c:\j2sdk1.4.2_04\bin\javaexamples1 When I try to run the files of javaexamples1 from c:> error cannot read.
Dirk Schreckmann
Sheriff
Joined: Dec 10, 2001
Posts: 7023
posted
0
What exactly are you doing to get exactly what error message?
Please post your question in a new thread if the topic is different.
kiran vydhyam
Greenhorn
Joined: Jul 22, 2004
Posts: 7
posted
0
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.
Marilyn de Queiroz
Sheriff
Joined: Jul 22, 2000
Posts: 9033
10
posted
0
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.
Dirk Schreckmann
Sheriff
Joined: Dec 10, 2001
Posts: 7023
posted
0
Again, what exactly are you doing to get exactly what error message?
It might help if you were to clarify, exactly what command are you executing.
Also, note that you can't run a source file. You first need to compile them, and then run a class. [ July 26, 2004: Message edited by: Dirk Schreckmann ]
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.