• 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

compiling error

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have just started Java and can't get my computer to compile any of the programs as the error that keeps appearing is that the file does not exist. Any suggestions?
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch.
How are you trying to compile your source file. Command line?
 
Charlotte Queenan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using the command prompt, although when I change the directly and try to find the file it says it doesn't exist.
 
Maneesh Godbole
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Trouble shooting I
I know this is kind of silly, but have you saved the file as .java after writing the code? Do you see the .java file in your explorer?

Trouble shooting II
Let us imagine your source file (MyFirstApp.java) is located under c:\MyApps.
To compile it, you need to
1) Navigate to c:\MyApps
2) Run the command javac MyFirstApp.java*

*I have intentionally highlighted the 'c' and 'java' parts because those are one of the typical mistakes beginners do.
Are you following the corresponding steps? Do you still get the error?

Trouble shooting III
If the above dont work, can you copy past the actual error?

 
Charlotte Queenan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes the. Java is at the end of the filename and its in my documents, not my explorer. Should it be in the explorer and if so how would I save it there?
 
Maneesh Godbole
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Charlotte Queenan wrote:Yes the. Java is at the end of the filename and its in my documents, not my explorer. Should it be in the explorer and if so how would I save it there?



.Java? Does it say .Java instead of .java? In Java case does matter. If yes, you will need a .java file
By explorer, I meant the explorer window where you see all the files and folders on your system. If it is in my documents it is ok.

I would recommend you confirm the extension for .java then try out the steps I mentioned in Trouble Shooting II above.
If you still get the error, please copy paste the error here
 
Charlotte Queenan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The error
States " The system cannot find the path specified"
 
Maneesh Godbole
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Maneesh Godbole wrote:
If the above dont work, can you copy past the actual error?



Maneesh Godbole wrote:
If you still get the error, please copy paste the error here



What I meant was can you copy paste the stuff displayed in your command prompt. Check sample below



 
lowercase baba
Posts: 13089
67
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Charlotte Queenan wrote:The error
States " The system cannot find the path specified"


Charlotte,

You really need to give us as much information as possible for us to help you. this alone is not enough. What exactly do you type on the command line? What directory are you in? What directory is the .java file in?

All of these things matter. The more information you give, the easier it is to figure out where the problem is.
 
Marshal
Posts: 79179
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Another suggestion:

Are you on Windows? Are you using Notepad as a text editor? Do you have the "hide extensions for known file types" option in "file options" ticked? In that case, Notepad is capable of saving your work as MyClass.java.txt and the "hide extensions" pretends the .txt extension isn't there.
Don't use Notepad; try Notepad++ Notepad2 or jEdit (or other suggestions you will find in this forum).
 
You are HERE! The other map is obviously wrong. Better confirm with this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic