Link to home
Start Free TrialLog in
Avatar of Shawn Peari
Shawn Peari

asked on

First program

Hi, i have written my first program in java and named it HelloApp.java as a java file, but when i use command prompt to compile it, it gives me this error: javac: file not found: HelloApp.java
I don't  know what is wrong and can someone please help me?
Avatar of mccarl
mccarl
Flag of Australia image

Can you provide the entire program, and can you give a screenshot of the command prompt window that you are compiling with?
Avatar of Shawn Peari
Shawn Peari

ASKER

User generated image
Ok, so you HelloApp.java file is in... C:\Users\Shawn\Desktop\Java  directory but you are trying to compile from just...  C:\Users\Shawn  directory, so it's not going to be able to find the file.

Try...

cd Desktop\Java

Open in new window


in the command prompt before trying the compile commands that you have above
u are trying to compile the java program which is not your directory try to add c://user//shawan//desktop//java//Helloapp.java
First navigate your cmd to that location and compile javac.HelloApp.java Then Run java HelloApp.java it's 100% work
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.