Install Java and Eclipse

Today's files are BIG. Consider a flash drive.
Vista Users Take Note: You may have to run Eclipse as an Administrator. Right Mouse Click on "eclipse.exe" → Run As Administrator → Run → Allow. There may be a better permanent solution as discussed on EclipseZone or tell the program to always run as an administrator as explained on Vista Forums.



You'll find the history of Java to be fascinating. Did you know that the original designer of Java was James Gosling from Calgary, Alberta?

Pop on your earphones and watch and listen to the following flash presentation on the: History of Java from PublicStaticVoidMain.



and Install
The Latest
Version of

Java SE
Download Page


Sun MicroSystems owns Java. The Sun Developer Network (SDN) is the single best source for information concerning Java.

The abbreviation "IDE" stands for Integrated Development Environment.

You need NOT download or install the Java installation bundle that includes the NetBeans IDE, but you are encouraged to do so to do so because the NetBeans IDE because it is one of the best IDEs (Integrated Development Environment) available. That said, at this point in time (June 2008), the Eclipse IDE will be used because your teacher believes that the Eclipse IDE is even better than the NetBeans IDE for learning. The Eclipse IDE is currently used and supported by more post-secondary institutions and professional Java programmers than any other IDE.

When installing software, it is generally wise to use the default locations unless you have a particular reason to do otherwise. If you do save the software in locations other than the default locations, then you must ensure that all references to the software's path are changed everywhere.

Pay particular attention to Sun's Installation Instructions. Most of you will use the instructions to install Java on a 32-bit Windows platform.

When downloading Java or the Java Documentation, you must first accept the license agreement to download the product by clicking the appropriate "radio button".

Configure a Working Windows Environment.

Sun MicroSystems Installation Notes also explain how to update the path variable for Java. The notes say that updating the path variable is "optional". Disregard that advice and ensure that you do update the path variable to avoid having to type the very long path every time you compile or run a java program.



and Install

Then Pin The
To Your
Start Menu.

Java SE
Download Page

To Install

The JDK API Documentation is comprehensive, logically organized and easily read. It is the Java Owner's Manual. Java is far too large to memorize. Learning to use Java's documentation will arm you with the same skills that are required to work with other modern systems of knowledge which are also organized by rules of logic and syntax. Such systems are extensively used in medicine, law, engineering, science, chess, music and virtually all academic pursuits.

Return to Sun's Java Download Page. Scroll down the page to the section entitled, "Java SE 6 Documentation". Left-Mouse-Click the download button.

Follow Sun's Installation Instructions for Documentation with the following exception.

Sun says that you can store the documentation anywhere, but it is customary to store the "docs" directory in the "jdk" directory: the "jdk1.6.0_01" directory at the same location as are the directories "bin", "demo", "include", "jre", "lib" and "sample".

After the documentation is installed, pin a shortcut in your start menu to the API Specification. This is the "Dictionary of Java". [See next paragraph.] You will use this resource often as you learn to program using Java.

Pin Specs Shortcut to Start Menu. Navigate to the the API index file. The path to the file will look something like, C:\Program Files\Java\jdk1.6.0_01\docs\api\index.html. Ensure that you are in the api directory. --> Right-Mouse-Click the file and click "Create Shortcut". This will create a file called "Shorcut to index.html". --> Left-Mouse-Click that file and, while continuing to press the left mouse button, drag the name of the file to the start button which is usually located at the far left of the taskbar at the bottom of the screen. --> While continuing to press the left mouse button, the start menu will open. --> Continue to drag the shortcut name of the file to where you want it located on the start menu. --> Release the mouse button. --> Right-Mouse-Click the shortcut name ("Shortcut to index.html) and choose "Rename". Change the name to something like "Java 6u1 API" which translates as "Java Version 6 Update Number 1 Application Programming Interface".



Eclipse JDT
At Home

Eclipse News Groups

NCSU Eclipse Tutorial [csg] [web]

UBC Eclipse Tutorial [csg] [web]

Punahou Eclipse Tutorial [csg] [web]

Enrique S. Valle Tutorial [csg] [web] Eclipse Tutorial [web]

UofM Eclipse 3.1 Tutorial [csg] [web]

At time of revising this paragraph (June 1, 2008), the most recent version of Eclipse is (was) version 3.3.4, also known as Eclipse Ganymede. A then recent, excellent tutorial airmed at first time Eclipse users (but who are experienced programmers) of Eclipse is:

Using Eclipse Ganymede - A Tutorial

Note that the following directions are give for downloading the "Europa" version of Eclipse, an slightly earlier version of Eclipse, because that is the most recent version that is "bundled" with other "plug-ins" from a wonderful company called Omondo. We will later want to use Omondo's plug-ins when we learn about UML (Unified Modelling Language).

The Eclipse JDT (Java Development Toolkit) is reputedly used by more than half of all professional Java programmers. Eclipse itself is simply a "framework" into which all sorts of "plug-ins" may be integrated. All the plug-ins that we will use, including the JDT, are already integrated into Eclipse when you download it.

It takes a bit longer to learn to use Eclipse to develope Java programs than an editor like TextPad, but the power and convenience of the many tools and plug-ins that work with Eclipse make it possible to learn and become a productive programmer sooner than with a less powerful environment.

IBM spent $40 million U.S. dollars developing Eclipse and then gave it to the nonprofit Eclipse Foundation. Tools implement concepts. The more tools that you learn to use, the more concepts you will internalize. That makes you a better programmer and, more importantly, a more profound thinker.

Read the North Carolina State University Tutorial, Getting Started Using Eclipse [csg] [web].

You must properly install Java before installing Eclipse since Eclipse uses Java.

Install Omondo's EclipseUML Free Edition

  1. These directions assume that the latest version of Java's SDK has been installed and added to the system's environmental path variables.

  2. Install Omondo's bundle of Eclipse and the Eclipse plug-ins: EclipseUML Free Edition, EMF (Eclipse Modeling Framework), GEF (Graphical Editor Framework) and UML2.

  3. Extract the zipped file to the root of c:\ which results in everything sitting in c:\eclipse.

  4. Create a shortcut of the c:\eclipse\eclipse.exe file and copy the shortcut to the start menu.

  5. Eclipse records all of its plugins after Help → About Eclipse Platform → Plug-in Details.

Caveat:   Diagrams created at home using Omondo's EclipseUML Free Edition cannot be restored with another installation of EclipseUML Free Edition, including the school's installation, and vice versa.

This is a free edition and a studio edition of EclipseUML. The free edition will cover your modeling needs while learning UML.

Students using only EclipseUML Free Edition should be prepared to do all of their UML diagrams exclusively on either their home or school computer.

EclipseUML 2007 Europa Studio Edition, costing $3,490US for 10 academic licenses (25 December 2007), can restore EclipseUML Free Edition diagrams.




Import UBC Format Codes

This sets:

Eclipse can automatically format source code according to specific rules that you give Eclipse. The menu command to do this is Source --> Format. The hot keys to do this are [Ctrl] + [Shift] + [ F ].

Code must be formatted such that it is most easily read. A general design principle for readability is "lots of white space." This course requires that you implement BIG JAVA's style for formatting code. You will now set the Eclipse JDT plug-in to optimize that design principle.

Do this to import the style format used in the UBC course CPSC 211.

Alternatively, you may labouriously set each format feature yourself by doing the following. Launch Eclipse. --> In the top menu, click Project. --> click Properties. --> Open the Java Code Style by clicking on the [+] sign beside that label. --> Click Formatter --> Place a check mark [] in the box beside Enable project specific settings --> Click the New... button. --> In the Profile Name: window, type your first name. --> Choose Eclipse [Built-in] beside the label Initialize settings with the following profile. --> Place a check mark [] in the box beside Open the edit dialog now. --> Click OK --> An Edit Profilie window with eight tabs at the top appears.




From Eclipse HELP:

  1. Drag & Drop or Copy & Paste

  2. Import Wizard

Sometimes you will have a java source code file that you developed in another application, like TextPad. Sometimes you will find java source code on the Internet or on a CD from the back of a Java book. How do you bring that source code into Eclipse?

  1. Create a new Eclipse project. Give it an appropriate name.

  2. Create a new Eclipse package. Note that the source code may already have a package name that you may care to use. If you choose a different package name, then you will have to adjust the package name in the individual source code files for each Class.

  3. You may now drag and drop or copy and paste the files from their source directory to an appropriate place in Eclipse's Package Explorer.

    Alternatively, you can use Eclipse's Import Wizard.





Incorporate JUnit Testing with Eclipse.

  • You will use JUnit version 4+ which requires Java 5 or later. Therefore set compiler compliance to SDK 5 or later after Window → Preferences → Plus sign "+" beside "Java" → Compiler → find "Compiler Compliance Level" → Choose 5.0 or later from the drop down menu.

  • Add the JUnit files to the Eclipse classpath: File → New → JUnit Test Case → Click the radio button for "New JUnit 4 Test" → Near the bottom it says, "JUnit 4 is not on the build path of Project ?whatever? Click here to add JUnit 4 to the build path and open the build path dialog." → Click on the link "Click here" → Click the plus sign "+" beside "JUnit 4" → Select by clicking "junit.jar-...\eclipse\plugins\org.junit4...." → OK.

  • Now learn to use JUnit Testing with Eclipse by following a tutorial such as Java Unit testing with JUnit 4.x in Eclipse - Tutorial by Lars Vogel, beginning with his example class, MyFirstJUnitTest.

  • Ignore this if you wish, but the latest version of JUnit on 24 December 2007 was JUnit 4.5. A jar file containing a snapshot of the JUnit 4.5 files can be downloaded from here. [A jar file is a java specific compressed "zip" file. The word "jar" stands for "Java Archival". A "snapshot" of files is a collection of files.]

  • Ignore this if you wish, but release notes for versions JUnit 4.4 and 4.5 will be found at

[Counter On Strike [Home of Gerry Donaldson's Com Sci Gate]
[Gerry Donaldson's Email Address]
[EFC Blue Ribbon - Free Speech Online]

On the Internet Since March 9, 1996    URL:    Last Revised:   June 1, 2008.