A
A
Alexander Maslennikov2015-10-17 13:32:36
Java
Alexander Maslennikov, 2015-10-17 13:32:36

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:
aa4aa4dc451542f09b900ffd229f37d4.png
The HelloWorld.java file itself lies on the desktop (actually, wherever it is, the result is the same).
Terminal window:
904a6206f6264a36bd0ad64c4e0e1b65.png
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

6 answer(s)
A
Alexander Vasilenko, 2015-10-17
@ALVelvet

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...

P
protven, 2015-10-17
@protven

You are cd to file! Are you eligible? Start by learning the basics of computer ownership.

A
aol-nnov, 2015-10-17
@aol-nnov

aftar, do not torment the console!
There is an IDE for Java. Eclipse, Netbeans, IntelliJ - everything is available for Mac.

V
Vladimir Martyanov, 2015-10-17
@vilgeforce

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.

P
petrwahington, 2015-10-17
@petrwahington

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

N
Nikita, 2015-10-17
@jetu

f*cking… f*ck you bought a poppy if you don't know how to work properly with the terminal?!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question