Click to See Complete Forum and Search --> : javac will not compile


mr.popper
06-11-2005, 10:44 AM
I have installed j2sdk1.4.2_08, but javac will not compile my programs. I type

Code:
javac source.java


but all it does is display the options for javac, no matter whether the source.java file existed or not.

Even if I did

Code:
javac ./source.java


the results were the same.

Any ideas would be appreciated.

Thanks,

mr.popper

je_fro
06-11-2005, 11:45 AM
are you in the same directory as your source file?

mr.popper
06-11-2005, 12:40 PM
yes I am. the compiler displays the options whether the sourcefile is there or not. It is very strange

hlrguy
06-11-2005, 12:53 PM
javac source

it is probably trying to find source.java.java.

hlrguy

mr.popper
06-11-2005, 12:59 PM
The options just are displayed again.

evac-q8r
06-11-2005, 08:27 PM
Have you already put the java bin directory e.g. /usr/java/j2sdk1.4.2_03/bin in your path??? Or perhaps the permissions on the file aren't correct??

-EVAC

phlipant
06-11-2005, 08:42 PM
try /usr/java/j2sdk1.4.2_03/bin/javac source.java You might be executing a javac compiler from some other broken distribution.

whk
06-16-2005, 09:46 PM
try it in root or chmod +x

fatTrav
07-03-2005, 12:50 PM
You'll need read permissions not necessarily write permissions to your source file. (Mine are usually 600.) You can always try the verbose (-verbose) switch to see what the compiler is doing.