File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Cannot compile java applications Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Cannot compile java applications" Watch "Cannot compile java applications" New topic

Cannot compile java applications

Subir Chetia

Joined: Jan 26, 2001
Posts: 10
I had installed jsdk 2. But when I try to compile a java file it says cannot read the specified file. I had also given the required parameters in the autoexec file sitll the problem is persisiting. Please help.
Daniel Dunleavy
Ranch Hand

Joined: Mar 13, 2001
Posts: 276
I can't think of anything except making sure to set path and classpath. Run in dir where your source code is, or add it to path.
Cindy Glass
"The Hood"

Joined: Sep 29, 2000
Posts: 8521
A common mistake is to use wordpad or something and then forget to save the file as .txt. The java compiler can not read a file saved as a word document even if it is named .java.

"JavaRanch, where the deer and the Certified play" - David O'Meara
Subir Chetia

Joined: Jan 26, 2001
Posts: 10
Thanks mate. My problem is solved - I had saved the files as .java.txt files by mistake.
I agree. Here's the link:
subject: Cannot compile java applications
It's not a secret anymore!