in java javac: file not found



hi friends

this is my first program in java and i get the error message could some help plz

C:\>javac first_prog.java
javac: file not found: first_prog.java
Usage: javac <options> <source files>
use -help for a list of possible options

thanks & regard
junior_in_oracleAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

CEHJCommented:
first_prog.java is not in the current directory. Did you save it?
0
junior_in_oracleAuthor Commented:
hi CEHJ

which directory you mean
0
junior_in_oracleAuthor Commented:


i told i'm newwwww plz be more specific  
0
Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

CEHJCommented:
The directory you're in. C:\
0
junior_in_oracleAuthor Commented:


the java is installed in this path

C:\Program Files\Java\jdk1.6.0_04\bin
0
CEHJCommented:
You don't really want to be in that anyway. Do the following and work there
mkdir "%USERPROFILE%\java-proj"
cd "%USERPROFILE%\java-proj"

Open in new window

0
junior_in_oracleAuthor Commented:


okay man

this is the result

C:\>mkdir "%USERPROFILE%\java-proj"
A subdirectory or file C:\Documents and Settings\mohammed\java-proj already exists.

C:\>cd "%USERPROFILE%\java-proj"

C:\Documents and Settings\mohammed\java-proj>

could you explain this later after you solve the problem pleeeeeeeeeeeeez
0
CEHJCommented:
Save the source file first_prog.java in there and run javac again
0
junior_in_oracleAuthor Commented:
sorry CEHJ

there is a new error could help plz

C:\Documents and Settings\mohammed\java-proj>javac first_prog.java
first_prog.java:1: class HelloApp is public, should be declared in a file named
HelloApp.java
public class HelloApp
       ^
0
CEHJCommented:
The class name must be identical to the name of the source file. Case-sensitive
0
junior_in_oracleAuthor Commented:


hi CEHJ

is this mean it's work

C:\Documents and Settings\mohammed\java-proj>javac helloapp.java

C:\Documents and Settings\mohammed\java-proj>
0
CEHJCommented:
Please post source code
0
junior_in_oracleAuthor Commented:


this is the source code

public class helloapp
{
public static void main(String[] args)
{
System.out.println("Hello, World!");
}
}

is there any error??
0
junior_in_oracleAuthor Commented:


CEHJ

why I should put all of my examples in this path (C:\Documents and Settings\mohammed\java-proj>)

could i put in another directory like this :

(c:\mywork) or

(c:\examples)
0
junior_in_oracleAuthor Commented:


hi CEHJ

it's work thanks for help and advice

could you provide me with website or links have examples and doc plz
0
CEHJCommented:
>>why I should put all of my examples in this path (C:\Documents and Settings\mohammed\java-
proj>)

Because that's where use files should be kept in Windows

Take the tutorials at Sun

http://java.sun.com/docs/books/tutorial/
0
junior_in_oracleAuthor Commented:


thank you CEHJ , I really happy to know you and i appreciate your help
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
CEHJCommented:
:-)

You don't close the question btw - you accept an answer or answers. Otherwise it give the site admins more work
0
junior_in_oracleAuthor Commented:


ok CEHJ, tell me how i'm new in this forum, and also tell me how i give u the point

plz, i'm new
0
CEHJCommented:
I don't think you can do anything now - let things take their course and don't worry about it too much
0
junior_in_oracleAuthor Commented:


ok, at least show tel me what exactly should i do after some answer my question . i don't want make this mistake again . sorry if there is any mistake in my english language
0
CEHJCommented:
>>ok, at least show tel me what exactly should i do

Well i did ;-) - you accept one or more answers. See http://www.experts-exchange.com/help.jsp
0
CEHJCommented:
:-)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java EE

From novice to tech pro — start learning today.