• Post Reply Bookmark Topic Watch Topic
  • New Topic

file not found  RSS feed

 
lai willy
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone,

I have followed this page
http://www.coderanch.com/how-to/java/how-to-create-java-program
to create my first java for some hours but fail.

(I use windows7 and notepad to compile )

by the way,I'm not sure where to put my .java(I try many different place)

123.jpg
[Thumbnail for 123.jpg]
 
Tushar Goel
Ranch Hand
Posts: 934
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello lai, Welcome to the Ranch !!!

It looks like you have put .java file in different older and trying to execute from the another folder. Please go to the folder where you put .java file and execute javac there...

 
lai willy
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi =)

I don't know what the "execute javac there" mean and how to do that
 
Paweł Baczyński
Bartender
Posts: 2083
44
Firefox Browser IntelliJ IDE Java Linux Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
lai willy wrote:I don't know what the "execute javac there" mean and how to do that

You need to change directory using cd command (like that: cd "C:\Program Files\java\src") and then use javac command.

I recommend you save your source files in your user directory. Maybe C:\Users\yoyo\java ?
 
Tushar Goel
Ranch Hand
Posts: 934
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

type cd path/Java/src on prompt sorry i am not familiar to your local language so please replace 'path' with the initial path of your directory where you stored it.
then
javac filename
 
lai willy
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for helping, I success to get .class file

by the way,why can't I use path variable to simplify these steps.
 
fred rosenberger
lowercase baba
Bartender
Posts: 12563
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the PATH variable is used by the OS to locate executables, not by some other program (like javac) to find files you want IT to find.
 
lai willy
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I see, thank you so much.
 
Tushar Goel
Ranch Hand
Posts: 934
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
PATH is used to set executable path not file path..
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!