General Question

Emmy1234's avatar

Can anyone coach me through how to use java on my Mac?

Asked by Emmy1234 (878 points ) January 22nd, 2014

I am a new programming student and my professor is lacking in teaching skills. Can anyone help out on how to get started on java with compiling a HelloWorld program? I know I go to terminal on Mac and I tried using TextEdit to type the program but I am at a loss on what to do next. I need help! Also I’ve watch tutorials on Youtube but mine doesn’t seem to go along with what they are doing.

Observing members: 0 Composing members: 0

5 Answers

johnpowell's avatar

You might want to start with Eclipse. This might help too.

I haven’t played with Java before but you might also need Xcode. It is free. I’m not sure if Eclipse has its own compiler or falls back on something else. I generally use GCC.

And really, your professor has office hours. Use them. You are paying them to teach. Would you let someone at McDonalds forget your fries without bitching? This is essentially what your instructor has done to you. This isn’t high school. You are now a paying customer.

funkdaddy's avatar

Programming Java on a Mac from Princeton, now you’re all Ivy League.

Emmy1234's avatar

@johnpowell- Well I tried eclipse and couldn’t get it to download. I did finally get it to compile using emacs write and then went back to terminal. I’m going to go see him tomorrow make sure I’m on the right track. @funkdaddy I looked at that too and could not get JEdit to download. I’m sure it is something I’m doing wrong. I’m new at this!

Yanaba's avatar

@Emmy1234 Your question could not have been timed better. I’m doing the same thing on the same system and have been having similar problems. Not with the programming, which I know a bit of, but with the setup. I took a course ages ago when I was still a PC user and everything was fine (nice compile+run button!), but with Mac it is more confusing. Silly because programming isn’t even the problem, it’s the dumb setup that isn’t really explained most places.

Before seeing this question I downloaded a few different editors: JEdit (which I like the best, nice and simple and open source), Eclipse (looks like it’ll be nice when I know more what I’m doing but WTF complicated and confusing at this time, documentation also not hugely helpful), and JGrasp, which I read was a nice lightweight editor for Mac.

JEdit requires a plugin to be installed before it can compile I think (took me ages to figure out what was wrong with me not seeing (visually) how to run things!)-ie. the Console plugin I believe-but is nicest of what I’ve seen. For a lot of these (all probably?) you also need to download the JDK (Java Development Kit) from Sun first, fyi. But depending on your version of OSX, you might need to use an older version than 7, which is the current JDK version. I use Snow Leopard and 7 gave me problems saying it was too old. What a confusing royal pain all this is.

Regarding commands, look into the “javac” and “java” commands for compiling and running things.

Somebody please correct me if any of this sounds wrong. Uh, I will try to help with what I can Emmy :) Possibly I can walk you through at least getting JEdit to download if you like. Send me a message? It’s pretty late here though so might be bed time.

Ok enough revealing my ignorance :)

Emmy1234's avatar

@Yanaba sorry late seeing this. I ended up pulling instructor aside at the end of class. He just had me use vim (FileName.java) through terminal. I also did use javac and java to compile and run. Thing are much clearer now! I have a feeling this class is going to be a disaster. All I can do is practice, read my book, and take notes!

Answer this question

Login

or

Join

to answer.

This question is in the General Section. Responses must be helpful and on-topic.

Your answer will be saved while you login or join.

Have a question? Ask Fluther!

What do you know more about?
or
Knowledge Networking @ Fluther