• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

compiler

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic