downloading, installing, and using eclipse for mac...

12
CIS260 Eclipse on Mac - 1 Downloading, installing, and using Eclipse for Mac OS Mac OS already has Java installed, so you don’t need to do anything with that. Make sure your software updates are current, and you will have the most recent version of Java. Head off to the Eclipse Download site: http://www.eclipse.org/downloads/ We want the IDE for Java Developers, but not the Java EE one. Most of the useful parts of JEE (Enterprise Edition) we will not use in this class. So, go for the smaller download. Download the Mac version (I downloaded the Carbon version, check your OS for the right one) and untar it to a directory on your hard disk.

Upload: others

Post on 29-Jul-2020

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Downloading, installing, and using Eclipse for Mac OSeecs.csuohio.edu/~sschung/ESC120/DownloadingEclipseOnMac.pdfThis is the executable you will click on to get to the Eclipse environment

CIS260 – Eclipse on Mac - 1

Downloading, installing, and using Eclipse for Mac OS

Mac OS already has Java installed, so you don’t need to do anything with that. Make sure your software updates are current, and you will have the most recent version of Java.

Head off to the Eclipse Download site: http://www.eclipse.org/downloads/

We want the IDE for Java Developers, but not the Java EE one. Most of the useful parts of JEE (Enterprise Edition) we will not use in this class. So, go for the smaller download.

Download the Mac version (I downloaded the Carbon version, check your OS for the right one) and untar it to a directory on your hard disk.

Page 2: Downloading, installing, and using Eclipse for Mac OSeecs.csuohio.edu/~sschung/ESC120/DownloadingEclipseOnMac.pdfThis is the executable you will click on to get to the Eclipse environment

CIS260 – Eclipse on Mac - 2

(You can ‘untar’ it by simply double-clicking) Now, you’ll have a folder called Eclipse. Drag the entire folder to your applications folder.

This is the executable you will click on to get to the Eclipse environment. You might want to drag a shortcut on to your dashboard for easy finding.

OK, now, click on the executable. It will now ask you about a workspace. Pick a good folder, or just use the default. Either is fine.

If you want, click the “Don’t ask me” checkbox.

Page 3: Downloading, installing, and using Eclipse for Mac OSeecs.csuohio.edu/~sschung/ESC120/DownloadingEclipseOnMac.pdfThis is the executable you will click on to get to the Eclipse environment

CIS260 – Eclipse on Mac - 3

Eclipse opens up. Behind each of the little bubbles on the page is information, samples, tutorials, etc. Feel free to explore on your own. When you are done, click on the little ‘x’ at the top of the page and the screen goes away.

Page 4: Downloading, installing, and using Eclipse for Mac OSeecs.csuohio.edu/~sschung/ESC120/DownloadingEclipseOnMac.pdfThis is the executable you will click on to get to the Eclipse environment

CIS260 – Eclipse on Mac - 4

Select Preferences under the Eclipse menu.

Select Java -> Installed JREs. I would suggest JRE 1.6.0.

Page 5: Downloading, installing, and using Eclipse for Mac OSeecs.csuohio.edu/~sschung/ESC120/DownloadingEclipseOnMac.pdfThis is the executable you will click on to get to the Eclipse environment

CIS260 – Eclipse on Mac - 5

Select Run/Debug -> Launching -> Launch Configuration. Select “Filter checked launch..” and select “Ant Build”, “Java Application”, and “JUnit.” (You can check the others if you want.) Click Apply, then OK.

Page 6: Downloading, installing, and using Eclipse for Mac OSeecs.csuohio.edu/~sschung/ESC120/DownloadingEclipseOnMac.pdfThis is the executable you will click on to get to the Eclipse environment

CIS260 – Eclipse on Mac - 6

Here is the starting page

We’ll now make our first program. Select File -> New -> Java Project

Page 7: Downloading, installing, and using Eclipse for Mac OSeecs.csuohio.edu/~sschung/ESC120/DownloadingEclipseOnMac.pdfThis is the executable you will click on to get to the Eclipse environment

CIS260 – Eclipse on Mac - 7

Give your project a good, meaningful name. Think for a few moments before you name it, because once you do, you are stuck with it. You can’t change it.

Page 8: Downloading, installing, and using Eclipse for Mac OSeecs.csuohio.edu/~sschung/ESC120/DownloadingEclipseOnMac.pdfThis is the executable you will click on to get to the Eclipse environment

CIS260 – Eclipse on Mac - 8

Make sure “Use project folder as root for sources and class files is selected. It will make your life easier.

Click on Finish

We are ready to make our first Java file. Select File -> New -> Class

Page 9: Downloading, installing, and using Eclipse for Mac OSeecs.csuohio.edu/~sschung/ESC120/DownloadingEclipseOnMac.pdfThis is the executable you will click on to get to the Eclipse environment

CIS260 – Eclipse on Mac - 9

Let’s look at this carefully. The first thing is the Source Folder is the name of the project. Then, we need a “Package.” A package is an enclosing structure for Java programs. Again, make sure you give it a good name. I called mine “Hellopkg.” Now, we have to name the actual program: We are calling ours “HelloClass.” Finally, since this is the starting point of our project (as our programs get bigger, we will have

Page 10: Downloading, installing, and using Eclipse for Mac OSeecs.csuohio.edu/~sschung/ESC120/DownloadingEclipseOnMac.pdfThis is the executable you will click on to get to the Eclipse environment

CIS260 – Eclipse on Mac - 10

multiple files and folders in our projects. So we can only do this part ONCE.) we check “public static void main…”

When you are happy with the names, click Finish.

We get all this “for free.” We now have a starting point for our program.

Page 11: Downloading, installing, and using Eclipse for Mac OSeecs.csuohio.edu/~sschung/ESC120/DownloadingEclipseOnMac.pdfThis is the executable you will click on to get to the Eclipse environment

CIS260 – Eclipse on Mac - 11

Let’s add in some code and compile and run the program.

Here is the code

Note that the editor has changed the color of some of the words – these are keywords, comments, and literal sets of words (strings).

Page 12: Downloading, installing, and using Eclipse for Mac OSeecs.csuohio.edu/~sschung/ESC120/DownloadingEclipseOnMac.pdfThis is the executable you will click on to get to the Eclipse environment

CIS260 – Eclipse on Mac - 12

Now, we’ll select Run -> Run As -> Java Application

And there we have it. The program runs!

We’ll talk about fixing errors in class. Make sure you can get this far!