Download Setting up Java and Eclipse

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
Setting up Java and Eclipse
If you want to set up Eclipse and Java on your own computer, start at 1). If you’re using a
computer that already has Eclipse and Java installed and working, start at 3) to learn how to
compile code in Eclipse.
1) Download the Java development kit
Go to http://java.sun.com/javase/downloads/index.jsp and download the latest version of
the Java Development Kit (JDK) installer (exe) file. Choose offline installation if given a
choice. Run the file and follow the on instructions. Accept all default choices/options.
The directory you install to doesn’t matter very much. Either C:\jdk1.5.0_0x or
C:\Program Files\jdk1.5.0x (x some number) works fine.
2) Download Open Source Physics files
Go to http://www.opensourcephysics.org/develop/source-code/core/v1.0/ and download
the latest version of the Core OSP files (probably 1.0.2+). Extract the contents of the zip
file to a convenient location.
3) Download Eclipse
Go to http://www.eclipse.org/downloads/ and download the latest version of the Eclipse
SDK. Extract the contents of the zip file to wherever you want Eclipse to live – either
C:\Eclipse or C:\Program Files\Eclipse works fine. Double click on eclipse.exe in the
main (named eclipse) directory to run Eclipse. There is no installation procedure. If
Eclipse asks you to choose a workspace, choose a convenient directory. Eclipse creates
new projects in this directory.
4) Create a new project and test everything
Projects in Eclipse provide a way of organizing all of the files associated with the
development of an application or program. To create projects to develop Java programs
using OSP libraries, open Eclipse, and select New > Project from the File menu. Select
Java Project from the list in the window that comes up, and click next. In the next
window, enter a name for your project, and select the radio button “Create separate
output and source folders”. Click next, and choose an output folder. Either ‘bin’ or
‘classes’ works. Then click finish. The file structure of the project should appear in the
Package Explorer pane on the left hand side. To import the OSP Core source files (this
should already have been done if you are using a lab computer), right click on the src
directory icon in the Package Explorer pane and go to import. Choose File System in the
window that comes up, click next, choose the directory that contains the extracted OSP
source files from Step 3, and click finish. All of the source files are automatically
imported. To test everything, open the demo directory icon in the Package Explorer pane,
right click on FirstPlotApp.java, go to run as, and choose Java Application. A window
should appear displaying a plot of a sine function.