Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

Compile and run java on Mac via Terminal

Loading...

Sign in or sign up now!
31,413
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Feb 16, 2009

This is a small tutorial on how to run a java applet on mac using terminal, if u have any questions just comment.
If u cant find a program here use this

class hello
{
public static void main(String args[])
{
System.out.println("Hello world");
}
}


hope it helps :D

Category:

Education

Tags:

License:

Standard YouTube License

  • likes, 3 dislikes

Link to this comment:

Share to:

Uploader Comments (ratulcool1)

  • if i want to make an extra folder inside 'Documents' called 'Java'.

    and i want to store all my programs inside that 'java' folder' only.

    then how do we define the path in terminal?

  • @beingRaghu no probs just follow this command line:

    cd Documents

    cd Java

    then access ur file

  • @ratulcool1 k thanks.. it worked fine.but when i wrote the java applet code.

    ran it on terminal as u said.but still the msg appears saying "Exception in thread "main" java.lang.NoSuchMethodError:ma­in"

    .. ???

    do i need to install any additional softwares or something to run AWT applets on mac??

  • @beingRaghu hmmm...i really havent looked into using mac terminal for java applets....u can try this program called Blue J for mac...its a very simple and useful compiler and im very sure it can compile and run applets...

  • is the code different from that of windows? cuz the PSVM (main definition) ends with (string args[]) , I am a beginner, so tell me if I am wrong

  • @inditech96 no dont worry java is universal and the code doesn't change. Yes your right (String args[]) is used but it is not really required when using such a compiler :D

see all

All Comments (40)

Sign In or Sign Up now to post a comment!
  • Do I have to install a software on my Mac to work with Java programming? or it's already installed with my Mac?

    I wanna make sure, thanks

  • @Thefuzzyman83 when you save select plain text from the drop down menu at the bottom of the pane that appears, then change the .txt to .java

  • I copied your diamond file on TextEdit but when i try to save it, it only allows me to save it as a .rtf when i try to change the extension to .java. PLEASE HELP

  • thanks for the help!

  • easy on the Enter key.. hehe!

  • many thanks to you.

  • The osx operating system compiles just like any other program. You don't need any extra flags for a simple program like this. javac hello.java will still work. Thanks for posting the vid.

  • Thank you so much! Other videos didn't help at all /: this certainly did, and it was exactly what i was looking for(:

  • whats cd? my .java is not on my pics folder... and copying the path doesnt work?

    what if i have various layers?

Loading...

0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more