PDA

View Full Version : [Help] Coding


xilica
05-25-2002, 05:51 PM
I wrote a hello world program... everything seems fine except when i compile it in ms-dos
using javac
someone said my javac is in the wrong path.... can someone please help me..
my javac is in this directory

C:\JAVA\jdk1.4.0\bin\javac.exe

inkedmn
05-25-2002, 06:36 PM
i'd help you out if i knew more about java :)

/me passes the baton to Dru...

(oh, btw, my wife ok'd the purchase of "thinking in java" from bookpool.com !! :) :))

Strike
05-25-2002, 08:39 PM
What does your PATH look like? echo $PATH
If C:\JAVA\jdk1.4.0\bin\ isn't in there, it won't be able to find it if you just type "javac". But you should still be able to compile it by typing "C:\JAVAJ\jdk1.4.0\bin\javac HelloWorld.java" and then running "C:\JAVA\jdk1.4.0\bin\java HelloWorld", assuming the CLASSPATH is set up right (probably not a great assumption).

DukeofNukes
05-25-2002, 10:04 PM
This is why I prefer doing compiling and debugging on my Linux box.

Strike
05-26-2002, 12:11 AM
Originally posted by DukeofNukes
This is why I prefer doing compiling and debugging on my Linux box. ditto :)

Dru Lee Parsec
05-27-2002, 01:59 PM
Add C:\JAVA\jdk1.4.0\bin to your path.

Also, read the documentation about classpath. Classpath is a new environment variable in Java that tells the OS where to find your compiled class files. The Java tutorial http://java.sun.com/docs/books/tutorial/ has a good section on building a Hello World program (and the problems you're running into ) here : http://java.sun.com/docs/books/tutorial/getStarted/cupojava/win32.html

Also, you can go to my sourceforge project page at http://tapper.sourceforge.net/ and click on the "README Files" page. Scroll down a little bit to the section entitled "A Brief Discussion of Classpath". This will give a bit more detail about Classpath.

Hope it helps.

BTW, I agree, it's SO MUCH EASIER to change environment variables onteh fly in Linux.