• Post Reply Bookmark Topic Watch Topic
  • New Topic

compiler  RSS feed

 
Naim Driss
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hallo,


when i typed dir after this command C:\java>, i becom a .java.mht file.
..when i tried to compile with javac HelloWorldApp.java. It shown
javac: file not found: HelloWorldApp.java

Can you please help me?

Thank 's
 
Bill Cruise
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It sounds like you need to set up Java in your system's PATH variable. This tutorial on How to set up Java has details on how to do that in a variety of operating systems.
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think your PATH is okay, because otherwise the error message would be something about an unrecognized command.

.mht is a file extension for MHTML (MIME HTML), so I suspect the editor you're using to create your Java source files is saving the files as the wrong type. (Are you using MS Word, by chance? )

If that's the case, you should probably find a different editor. Tell us what operating system you're using, and we can suggest some free downloads. (Even Notepad might be better than Word.)

If you want to keep your current editor (for the moment), how to work around this depends on the application you're using. But in general, make sure that your file format is plain text. When you save, save as a generic type like "all files" or ".*". If it still adds a different extension after ".java," then try putting your file name in quotes ("HelloWorldApp.java").

Let us know what you're using and if this works.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!