@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 :)