Java程序辅导

C C++ Java Python Processing编程在线培训 程序编写 软件开发 视频讲解

客服在线QQ:2653320439 微信:ittutor Email:itutor@qq.com
wx: cjtutor
QQ: 2653320439
Eclipse install for MacOSX
For UAlbany CSI/CEN201 Fall 2016
Written by Lead TA Tom Reynolds, Aug. 22, 2016
Read all of this before starting.
**NOTE:  These instructions assume your Apple computer's Java functionality is up to date, and that you do not have 
any version of Eclipse already installed.  The Eclipse Project says you cannot update from an existing installation to 
Eclipse 4.5.2 (Mars2), the version to be used in this course.  If you try, it may seem to work but it might leave you with 
what Eclipse Project calls a "broken installation".  If you already have 4.5.2 installed and working, then you presumably 
should be able to use that for this course.  The instructions below about updating Java and about setting the "Installed 
JREs" Preference remain relevant to that situation.***
Before you start installing Eclipse, you should first make sure your Java version is up to date.  To explain how to do that 
I have prepared separate instructions, which should be linked on the same course page(s) which have a link to this 
present Eclipse instructions file.  Eclipse 4.5.2, the version which is being used for CSI/CEN201, requires Java 7 or 
higher, but you should get and install the highest available version of Oracle Java, which at this time is Java 8 sub-
version 8u102.
Unlike Oracle Java, which pretty much takes care of itself, Eclipse might require some adjustment at times.  These 
present instructions are only about how to get and install Eclipse; and how to do a minimum setup of Eclipse's 
Preference Java > Installed JREs, to make sure Eclipse will work with your nice new Java 8u102.
The download webpage for the version to be used in this course is "Eclipse IDE for Java Developers" (the "IDE" 
package is what is used in this course), at URL
http://www.eclipse.org/downloads/packages/eclipse-ide-java-developers/mars2
In that webpage, click the download link for "Mac OS X (Cocoa) 64-bit".  The installer file name is eclipse-java-mars-2-
macosx-cocoa-x86_64.tar.gz.  No file size is shown, but from my download the file's size, according to my OSX GetInfo, 
is 174.4MB.  (On a more general download webpage at the Eclipse website the file size is shown as 167MB, but that 
may be based on a different definition of megabytes).
INSTALLATION STEPS:
STEP 1. Open a Terminal window and verify the Eclipse installer file checksum is correct.  That is a pretty good 
guarantee that the file you downloaded is not corrupted one way or another, and will not waste your time or maybe 
even harm your computer.  My separate instructions for making sure your Java is up to date, mentioned above, tell how 
to verify checksums, and the same basic process can be followed here.  For the Eclipse installer file we are using, there 
are three checksums, SHA512, SHA1, and md5.  So use the three commands "shasum -a 512", "shasum -a 1", and 
"md5".
The checksum values to be matched are:
filename: eclipse-java-mars-2-macosx-cocoa-x86_64.tar.gz
sha512 (a single very long number): 
b258ee9d2bbcfb8b7b5717f60c995d2d9732898515e3a47a6d6035a6d12c767500929be7c235ea041d9369fa1fee16
0dc57bd264235b095780db494af25a2eb7 
sha1: 53a9ad2b5f9138d1fe0630569185c446cb88c504
md5: fb81a7ba360d0b50275dd944fd7035d2
If the checksum values calculated on your Mac are not the same as what the Eclipse webpage said they should be, 
delete the file you downloaded and try again.  If still not right, bring your computer to Lab or to a TA office hours and ask 
for help.  
STEP 2.  Doubleclick the compressed installer file to get the application file, Eclipse.app.  Drag that file to wherever you 
put your application files; the "Applications" folder is the default for MacOSX.
Eclipse has an "Eclipse/Installation" webpage, at URL: 
https://wiki.eclipse.org/Eclipse/Installation  
That page has a link for v.4.5 installation instructions, "6 Steps to Install Eclipse", but that link has been bad for at least 
a few months.
STEP 3:  Start Eclipse like any other app, by doubleclicking on its file icon.  The first time you run it you will probably 
see a popup alert window saying the application cannot be started because it was not downloaded from the Apple 
Store, or maybe because the file is damaged or something.  There are a couple of ways to get around that.  You can 
change a global setting on your Mac, to allow many or all such new app files to be run, but that is not a good idea.  It is 
for your own protection that Apple is careful about what apps it allows to run.  The preferred way to choose, app by app, 
to use downloaded applications is to press the "control" key while doubleclicking on the app's file icon.  That will get a 
similar popup alert window, but this one will give you the option to allow the app to run.  You will have to do this only 
the first time; MacOSX will remember you approved this application, without weakening OSX's protection against other 
possibly unknown apps.
 
During the startup, you will get a popup window "Workspace Launcher" asking where you want your projects stored.  
The default is a sub-folder named "workspace" in your Documents folder, but you may want to modify the folder name 
to identify it better.  For example, "Eclipse4.5.2Workspaces" suits the way I work.  Whatever you do about this will be 
offered as default at later startups.  (There is a checkbox "Use this as the default and do not ask again", but do not 
check it.  This way you will see the Workspace Launcher every time you start Eclipse, and will be reminded about 
workspaces and where they might be located.)
Startup will end by displaying a "Welcome" page showing various helpful functionalities.  These will also show up later, 
so do Step 4 now instead.
STEP 4: You need to make sure to specify Eclipse's Java usage before you do anything further.  After all, the app is 
Eclipse for Java programming, and this is a Java programming course.  If you never installed any Eclipse before, 
Eclipse should have found your default Java and set Eclipse's Java Preference, and you should not have to do 
anything further.  (That is why I say to make sure your Java is up to date BEFORE installing Eclipse.)  When I first 
installed Eclipse 4.5.2, my default Java version was 8u31, and I had to change Eclipse's Java Preference after 
installing Java 8u102.
To access Preferences, click "Eclipse" at the left end of the screen-top menu bar, and select "Preferences" from the 
drop-down list.  In the Preferences window, in the left side pane, select Java > Installed JREs.
The next screenshot shows that Eclipse found my default Java, which I had not updated from 8u31.  So I closed Eclipse 
and got and installed the Java 8u102, then restarted Eclipse.  Eclipse still showed only the Java 8u31.
To make it easy to tell Eclipse to add the updated Java 8, I drag-selected the 8u31 "Location" entry in the "Installed 
JREs" Preference window and did Edit>Copy to copy the 8u31 version's full filepath.  I then clicked the "Add" button 
and got a smaller "Add JRE" pane.  In the "JRE Home" field in that pane I pasted the 8u31 version's location, then 
changed the "jdk1.8.0_31.jdk" part to be "jdk1.8.0_102.jdk".  And in the "JRE Name" field I typed "Java SE 8 
(1.8.0_102)".  The next screenshot shows how the "Add JRE" pane looked before I clicked "Finish".
Clicking "Finish" added the 8u102 entry to the "Installed JREs" Preference, but 8u31 was still checked and identified as 
default.  So I checked the left end box in the 8u102 line, by the "Name" entry, which made the 8u102 be identified as 
the default.  Also, to keep things simple and to minimize the chance of problems, I removed the 8u31 entry.  I clicked 
somewhere around the middle of the 8u31 line--not the left end checkbox--to select it, then clicked the "Remove" button 
on the right side of the window.  That deleted the 8u31 line, as can be seen in the next screenshot.
Finally, I clicked the "Apply" button in the bottom right corner of the "Installed JREs" Preference window, and I was 
done.  So you can see, if you update your Java to Oracle Java 8 before starting to install Eclipse, there will be less to do 
to set up Eclipse.
That's it.  You now have a base Eclipse ready to use for this course.
FURTHER INFORMATION:
Various books about Eclipse, not necessarily for exactly v.4.5.2 though, are available online, some for as little as $0.01 
plus shipping.