Eclipse Practice Exercise- CSCI 230

[1].Creating a new project

  • Go to the Java Perspective
  • Windows > Open Perspective > Java
  • Create a new project calledCSCI230.TestProject.YOURUSERNAME
  • check the “Create separate folders for source and class folders” under project layout
  • Place a package in it called edu.csbsju.cs.YOURUSERNAME
  • Place a class in the package called SimplePrint
  • Check the box to create a stub for main method
  • Add an interface (e.g. ActionListener)
  • Check the box to Generate comments
  • Write a println statement in method main
  • Notice that compiling is done automatically while coding
  • Right click on the java class file (.java)
  • Select Run As  Java Application
  • Change the main method to use a loop to print all command line arguments passed by the user (i.e. args[0], args[1]…)
  • Notice that as you doan error, the following can help
  • Pressing F2 (Eclipse tells you what is wrong)
  • Pressing CTRL and SPACE (Eclipse suggests solutions)
  • Right click on the java class file (.java)
  • Select Run As Run Configurations
  • Click on the Arguments Tab
  • Specify a parameters under “Program arguments” separated by spaces or lines
  • Click onApply thenRun
  • Add the following two attributes to your class: String nameandint age
  • Select Source  Generate Getters and Setters
  • Look at your code
  • Select Source  Generate Constructor UsingFields
  • Look at your code

[2].Migrating a new project to Eclipse (THIS IS JUST FYI…don’t try it unless you actually have a project that you’d like to migrate to eclipse)

  • Place all of your source files in a src folder inside your project folder
  • Create a bin folder
  • Create a new project
  • Type project name
  • Select “Create project from existing source”
  • Browse and select your project folder
  • Now your project works as if it has been created within Eclipse but it may not be under your workspace

[3].Creating a Connection to a CVS server a new project to Eclipse

  • Select the CVS Repository Exploring perspective
  • Right click in the CVS Repositories view
  • NewRepository Location …
  • Fill out form
  • Host: unix.csbsju.edu
  • Repository path: /home/cvs/CS230S10
  • User: YOUR LINUX USERNAME
  • Password: YOUR LINUX PASSWORD
  • Connection type: extssh
  • Check Validate connection on finish

[4].Importing a project to CVS

  • In theJava Perspective, right click on the CSCI230.TestProject.YOURUSERNAMEproject
  • TeamShare Project
  • Select CVS location
  • In the ShareProject Resources
  • Can instruct CVS to ignore files and folders in the given project using its .cvsignore
  • Highlight files to be ignored (Press Ctrl key while selecting & then Right click on them)
  • Select add to .cvsignore
  • Notice the .cvsignore file added to the parent folder containing the ignored resource (s) (Can be edited)
  • Note that each subfolder must have its own .cvsignore file  if you need to ignore resources having the same name but in subfolders  step must repeated for individual subfolders
  • Don’t ignore the .project files
  • Click on Finish
  • Add comment “This is project X release Y”
  • Click on Finish

[5].Checkout a module from CVS

  • File > Import > CVS - Projects from CVS
  • Choose the correct CVS location
  • Select Use an existing module …
  • Select Check out as a project in the workspace- CSCI230.TestProject.YOURUSERNAME(provide different name if desired)
  • Check Usedefault workspace location
  • Click on Head
  • Click Finish