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?
 
junior_in_oracleConnect With a Mentor Author Commented:


thank you CEHJ , I really happy to know you and i appreciate your help
0
 
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
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

 
junior_in_oracleAuthor Commented:


i told i'm newwwww plz be more specific  
0
 
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
 
CEHJConnect With a Mentor Commented:
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
 
CEHJConnect With a Mentor Commented:
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
 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.