Compiling Java

Status
Not open for further replies.

hanser

Ars Legatus Legionis
43,847
Subscriptor++
Or in Windows, you can also do

set path=C:\<path to java>\bin;%path%


Then javac <yourfile>.java will work. For the most basic of problems, classpath isn't really needed. Note: this setting of the path will end once the command shell you're working in is closed. This works in both Win9x and Win2K.

To add it permanently:

In Windows 2000, right click on My Computer -> Properties -> System -> under environment variables, add "C:\<path to java>\bin"


Under Win9x, add it into autoexec.bat before the trailing %path%


At least, that's how I recall doing it.
 

ske_ez

Seniorius Lurkius
15
I just thought of something else..

Make sure that the case-sensitivity of the filename matches the class name. This is always a classic mistake made by all. ;)
I know its problem for me to mistype *.java classname without a capital letter when I do a compile on the command prompt.

As a side note, TextPad is very good at being a good syntax sensitive editor and you can compile from its tools menu, this all depends if you are doing this from windows. :))

ske_ez
 

hanser

Ars Legatus Legionis
43,847
Subscriptor++
Originally posted by ske_ez:
I just thought of something else..

Make sure that the case-sensitivity of the filename matches the class name. This is always a classic mistake made by all. ;)
I know its problem for me to mistype *.java classname without a capital letter when I do a compile on the command prompt.

As a side note, TextPad is very good at being a good syntax sensitive editor and you can compile from its tools menu, this all depends if you are doing this from windows. :))

ske_ez


and

it gives me bad command or file name.

;)
 
Status
Not open for further replies.