Computer Science & Software Engineering |
CSCI 135 |
Installing Eclipse on your Windows computer
First install the Java JDK (see above).
There are a variety of different flavors of Eclipse.
The current version of Eclipse is named Photon, but the exact Eclipse version you use isn't so important.
Go to the Eclipse download page.
In the section "Get Eclipse Photon", click the Download 64 bit button. Choose Save File. Go to your downloads and click the dowlnoaded file to start installation. When the installation starts you will be asked which IDE you want. Choose Eclipse IDE for Java Developers, then choose Install (and accept the license agreement).
You can launch Eclipse from installation. If you do so, the first thing it will ask will be which directory you want to use as a workspace. This is the directory where all of your projects will be saved. You can accept the default, or, if you wish to save everything on a USB drive, you can change it here. (This is handy if you are bringing your projects back and forth to class with you.)
Go to the Eclipse download page. In the section "Get Eclipse Photon", click the Download 64 bit button. Choose Save File. Go to your downloads and click the dowlnoaded file to open the archive and then click on Eclipse Installer to start installation. When the installation starts you will be asked which IDE you want. Choose Eclipse IDE for Java Developers, then choose Install (and accept the license agreement).
You can launch Eclipse from installation. If you do so, the first thing it will ask will be which directory you want to use as a workspace. This is the directory where all of your projects will be saved. You can accept the default, or, if you wish to save everything on a USB drive, you can change it here. (This is handy if you are bringing your projects back and forth to class with you.)
First let's test and be sure the Java Virtual Machine (JVM) can be found by entering java -version (the exact version displayed will vary depending on what you installed):Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved. C:\Users\Michele>
Second, lets make sure the Java compiler can be found by entering javac -version :C:\Users\Michele>java -version java version "10.0.2" 2018-07-17 Java(TM) SE Runtime Environment 18.3 (build 10.0.2+13) Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.2+13, mixed mode)
If either java or javac is not found, you probably have a problem with your system PATH variable (see the instructions in Installing Java on Windows). You can move around your folders using the cd (change directory) command. So for example, if we have an Eclipse project called HelloWorld in the standard location, we can move to the folder containing the source files as follows:C:\Users\Michele>javac -version javac 1.8.0_60
As shown, the dir (directory) command displays a list of all files in the current directory. By default, Eclipse stores the compiled bytecode (*.class) in a separate directory from the source code (*.java). We can move into this directory using .. which is a handle for the directory back one level:c:\Users\Michele>cd workspace c:\Users\Michele\workspace>cd HelloWorld c:\Users\Michele\workspace\HelloWorld>cd src c:\Users\Michele\workspace\HelloWorld\src>dir Volume in drive C has no label. Volume Serial Number is 9251-5CF1 Directory of c:\Users\Michele\workspace\HelloWorld\src 07/28/2011 06:55 PM <DIR> . 07/28/2011 06:55 PM <DIR> .. 07/28/2011 06:21 PM 294 HelloWorld.java 1 File(s) 294 bytes 2 Dir(s) 14,858,080,256 bytes free
From the current directory, here is how we recompile the HelloWorld.java file and create a new HelloWorld.class file. We will then run the program:c:\Users\Michele\workspace\HelloWorld\src>cd ..\bin c:\Users\Michele\workspace\HelloWorld\bin>dir Volume in drive C has no label. Volume Serial Number is 9251-5CF1 Directory of c:\Users\Michele\workspace\HelloWorld\bin 07/28/2011 06:51 PM <DIR> . 07/28/2011 06:51 PM <DIR> .. 07/28/2011 06:21 PM 769 HelloWorld.class 1 File(s) 769 bytes 2 Dir(s) 14,858,125,312 bytes free
c:\Users\Michele\workspace\HelloWorld\bin>javac ..\src\HelloWorld.java c:\Users\Michele\workspace\HelloWorld\bin>java HelloWorld Hello world!
First lets test and be sure the Java Virtual Machine (JVM) can be found by entering java -version (the exact version displayed will vary depending on what you installed):Last login: Thu Aug 16 10:07:59 on console micheles-iMac:~ Michele$
Second, lets make sure the Java compiler can be found by entering javac -version :micheles-iMac:~ Michele$ java -version java version "10.0.2" 2018-07-17 Java(TM) SE Runtime Environment 18.3 (build 10.0.2+13) Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.2+13, mixed mode)
If either java or javac is not found or is an earlier version, run Software Update and then verify Applications -> Utilities -> Java -> Java Preferences is set to Java SE 8.micheles-iMac:~ Michele$ javac -version javac 10.0.2
As shown, the ls command displays a list of all files in the current folder. By default, Eclipse stores the compiled bytecode (*.class) in a separate folder from the source code (*.java). We can move into this directory using .. which is a handle for the folder back one level:micheles-iMac:~ Michele$ cd Documents micheles-iMac:Documents Michele$ cd workspace micheles-iMac:workspace Michele$ cd HelloWorld micheles-iMac:HelloWorld Michele$ cd src micheles-iMac:src Michele$ ls HelloWorld.java
From the current directory, here is how we recompile the HelloWorld.java file and create a new HelloWorld.class file. We will then run the program:micheles-iMac:src Michele$ cd ../bin micheles-iMac:bin Michele$ ls HelloWorld.class
micheles-iMac:bin Michele$ javac ../src/HelloWorld.java micheles-iMac:bin Michele$ java HelloWorld Hello world!
Page last updated: August 15, 2019