• Post Reply Bookmark Topic Watch Topic
  • New Topic

javac: file not found error  RSS feed

 
Lijo Johny
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am a novice in java, I installed jdk and also the path.
But while compiling the file Xi.java in E drive (where i wrote it) using javac Xi.java its giving the error javac: file not found: Xi.java
I think the path is correctly set because in cmd Javac -version is giving the proper output javac 1.7.0_09.
I didn't touch CLASSPATH as someone in this forum said it's not recommended for beginners to make changes to CLASSPATH.
Not only in E drive, in whatever drive if i make .java extension file, while compiling same error is printing.

Thanks in advance.
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.

The error simply means that the Java compiler cannot find your source file named Xi.java. Is that exactly what the name of the file is? When you type dir in the command prompt, do you see the file in the list? Or does it have another name (maybe Xi.java.txt)?
 
Lijo Johny
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
While typing dir in cmd Xi.java.txt is appearing. OK now how to remove .txt extension
 
fred rosenberger
lowercase baba
Bartender
Posts: 12564
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lijo Johny wrote:While typing dir in cmd Xi.java.txt is appearing. OK now how to remove .txt extension

That really depends on what OS you are using. I would guess windows.

IF you navigate to the file using windows explorer, you can right click on the file and rename it.

 
Tony Docherty
Bartender
Posts: 3271
82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
IF you navigate to the file using windows explorer, you can right click on the file and rename it.

You may have problems doing this if file extensions are hidden (which I believe is the default behaviour in Windows) but you should still be able to rename it from a command prompt using RENAME
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!