Answer the question
In order to leave comments, you need to log in
Running HelloWorld on Mac, what's wrong?
Friends, good afternoon!
The second day I'm racking my brains with the launch of HelloWorld on Mac.
The code itself:
The HelloWorld.java file itself lies on the desktop (actually, wherever it is, the result is the same).
Terminal window:
As you can see above, I've already tried everything, but I suspect that the problem is with the compiler connection.
I ask you to treat with understanding, I have recently taken up the study of the language.
Answer the question
In order to leave comments, you need to log in
Well, firstly... cd is a command to go to a directory, i.e., if your file is in the Desktop directory, then you need to go there:
So you will find yourself in a directory, where is your file. More useful commands to start with:
ls - look at the contents of the directory
pwd - look at the path
mkdir <folder_name> - create a folder
touch <file_name.extension> - create a file
cd .. - go to the previous folder.
If you really want to create and compile Halloworld on your desktop, see if the Desktop folder is in the directory where you are. Usually the poppy terminal starts as the root user, i.e.
1 - ls
2 - look directory
3 - if there is a folder Desktop -> cd Desktop
Next, you need to make sure that the file you created has the extension java. Those. HelloWorld.java
Then, in the directory in which your file is located, compile it
file will appear. To run it, write
And everything will work out.
PS: Do not listen to those who scold you for mistakes. To learn anything, you MUST make mistakes and correct mistakes. So, feel free to fight. Then everything will be simple and easy.
PPS: To learn how to use the terminal, take this course https://www.codecademy.com/en/courses/learn-the-co...
You are cd to file! Are you eligible? Start by learning the basics of computer ownership.
aftar, do not torment the console!
There is an IDE for Java. Eclipse, Netbeans, IntelliJ - everything is available for Mac.
As you can see above, the problem is that the commands give errors every time. You didn't even manage to execute cd, start by solving at least this problem.
I met with this error! Have you tried reinstalling your Mac. I suffered for a long time.
I decided to install Mac OS X as an advanced user through TeamViewer with hackmac. PC works great.
http://hackmac.ru/?page_id=50
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question