I cant run the java file in the command prompt | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

I cant run the java file in the command prompt

"Open a command prompt window and go to the directory in which you saved the file. We'll say that it's C:\sololearn. To compile your code, type javac ExampleProgram.java, and press Enter. If there are no errors in your code, the command prompt will take you to the next line and generate a bytecode file, ExampleProgram.class." What am I supposed to write? I write C:\Users\COMPUTER\Documents\JavaProjects javac ExampleProgram.java and a error keeps popping out

25th Feb 2017, 8:51 PM
Milton
3 Answers
+ 4
Windows? Did you change to the directory where the java file is stored? Command cd C:/Users/...
25th Feb 2017, 9:02 PM
Tashi N
Tashi N - avatar
+ 2
what error?
25th Feb 2017, 8:55 PM
Daniel S
Daniel S - avatar
0
I found out that Im supposed to search the folder using "cd c:\Users... etc." and not just copy and paste the root, im pretty new to programming sry, but they should explain that part better in the course.
25th Feb 2017, 9:10 PM
Milton