Lec_Eclipse (1) - EECS285 Eclipse Reference Kyle Roell...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: EECS285 Eclipse Reference Kyle Roell Eclipse • Free Open Source Java IDE • Available at eclipse.org Download 2 Downloading •Available for Windows, Linux or Mac •Enterprise Edition (EE) isn’t necessary. 3 Workspace •Choose a workspace to store your code. •This is a folder on your computer where all source code will be saved. •Change it later with File->Switch Workspace. 4 First Screen Click on workbench to start writing code 5 Main View •Create a project •File->New-> Java Project 6 Creating a Project •Project name is the overall name (proj1) •Default is fine for the rest •“Finish” to create project 7 Project Created •Project has been created •Highlight project. Create package: File->New-> Package 8 Package Options •Source folder is default •Package name is path to package •For EECS 285: eecs285.proj<#>.<uniquename> 9 Package Created •Empty package •Add a file: File->New->File 10 File Creation •Automatically places file in package •Name ends in *.java •Capitalized by convention •I used “HelloWorld.java” 11 Ready to write code Write code here File structure here 12 Hello World Play button compiles and runs. Run as Java Application See Classes, methods and variables here Console output here 13 Syntax Errors *Hover mouse over error to see suggested fixes Shows where errors in source are Shows which projects, packages and files have errors in them Lists which Class and method errors are in “Problems” tab lists errors and line numbers 14 Automatic Style • Window->Preferences • Java->Code Style->Formatter New to create custom profile 15 No Tabs! •Make sure you set “Tab Policy” to spaces only •The right side changes to reflect options selected •To change existing code, select code then Source->Format 16 Line Numbers • To show line numbers • Window->Preferences • General->Editors-> Text Editors • Show line numbers 17 Andrew M. Morgan Submission • File->Export • Java->JAR File • Next 18 JAR Options •Select the project •Select export source files •Set name as: <uniquename><proj num> Browse to set folder where it’s saved. •Select “Add directory entries” •Next twice to “JAR Manifest Specification” 19 JAR Exporting Use defaults but select class with main function 20 ...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online