Link to home
Start Free TrialLog in
Avatar of junior_in_oracle
junior_in_oracle

asked on

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
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

first_prog.java is not in the current directory. Did you save it?
Avatar of junior_in_oracle
junior_in_oracle

ASKER

hi CEHJ

which directory you mean


i told i'm newwwww plz be more specific  
The directory you're in. C:\


the java is installed in this path

C:\Program Files\Java\jdk1.6.0_04\bin
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



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
SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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
       ^
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial


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>
Please post source code


this is the source code

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

is there any error??


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)


hi CEHJ

it's work thanks for help and advice

could you provide me with website or links have examples and doc plz
>>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/
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
:-)

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


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
I don't think you can do anything now - let things take their course and don't worry about it too much


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
>>ok, at least show tel me what exactly should i do

Well i did ;-) - you accept one or more answers. See https://www.experts-exchange.com/help.jsp
:-)