java

Posted:
in macOS edited January 2014
alright i have a computer programming class based on java. now i want to run java and the file on a mac. how do i do this. cause i can not find a good place to tell me. please help.

Comments

  • Reply 1 of 2
    Quote:

    Originally posted by Rise Above

    alright i have a computer programming class based on java. now i want to run java and the file on a mac. how do i do this. cause i can not find a good place to tell me. please help.



    Well, I am taking AP Computer Science and using Java so I had to get Java working as well. I downloaded the latest JDK for Mac from Sun. There are multiple text editors you can use, but I use jEdit. Sun offers a guide here.



    In addition to their guide I will just give a little guide. Say you write a program and save it to the desktop (Save it with the .java extension) open a Terminal window. Type cd to navigate to where the file is. So now you would type "cd desktop" Once you have done this, type in "javac nameOfProgram.java" This compiles it. If there are no errors you can type in "java nameOfProgram"
  • Reply 2 of 2
    hirohiro Posts: 2,663member
    The JDK's are default installed by Apple, you can update them via the Developer Tools install on the OS X system install disks, and get the very latest versions from Apple Developer Connection with a free account.



    http://developer.apple.com/



    Java runs exactly like any other UNIX/Linux/Windows from the command line. Just follow the same conventions you see in whatever text you are using. The above post has the basic basics correct.
Sign In or Register to comment.