How To Run Java on a Mac

In Progress…

Java Part 2

Java Part 1 explained how to install Java on a Mac.  Part 2 will explain how to compile and run a Java program on your Mac.

To compile and run a Java program on your Mac, it’s not great revelation that you need to create a Java program first!

To do that, open your favorite text editor.  Create a new file and call it HelloUniverse.java.  Note that “HelloWorld” is a tradition when learning a new language but we think “HelloUniverse” is more fun!

Add this code to HelloUniverse.java.

public class HelloUniverse

{   public static void main(String[] args)

{ System.out.println(“HelloUniverse.main says Hello!”);

}

}

 

Author: amarlette27

Leave a Reply

Your email address will not be published. Required fields are marked *

Copyright © 2019 Laptopcat Corp. | Design by ThemesDNA.com
top Comodo SSL