Difference between revisions of "User:Qinzhi"

From CDOT Wiki
Jump to: navigation, search
Line 6: Line 6:
 
     4)Doubleclick eclipse.exe in c:\eclipse\Basics\eclipse
 
     4)Doubleclick eclipse.exe in c:\eclipse\Basics\eclipse
 
     5)Workspace type ./wksp/lab
 
     5)Workspace type ./wksp/lab
     6)Download and install SVN according the instruction at http://zenit.senecac.on.ca/wiki/index.php/Basics_:_Install_Eclipse_Plugins
+
     6)Download and install SVN according the instruction at
     7)Download JUnit from https://github.com/KentBeck/junit/downloads and unzip it to c:\junit4.9b2.
+
    http://zenit.senecac.on.ca/wiki/index.php/Basics_:_Install_Eclipse_Plugins
     8)Add junit-4.9b2 to the CLASSPATH, for example: classpath=.;c:\junit4.9b2\junit-4.9b2.jar;c:\junit4.9b2
+
     7)Download JUnit from
 +
    https://github.com/KentBeck/junit/downloads and unzip it to c:\junit4.9b2.
 +
     8)Add junit-4.9b2 to the CLASSPATH, for example:
 +
    classpath=.;c:\junit4.9b2\junit-4.9b2.jar;c:\junit4.9b2
 
     9)Test if junit is installed correct or not by typing:
 
     9)Test if junit is installed correct or not by typing:
      java org.junit.runner.JUnitCore org.junit.tests.AllTests
+
    java org.junit.runner.JUnitCore org.junit.tests.AllTests
 
     If it display ok (508 tests), it means junit is installed correctly.
 
     If it display ok (508 tests), it means junit is installed correctly.
 
   2. Creating your first Java project
 
   2. Creating your first Java project
     1)In menu, click file->new->Java project.
+
     1)Open our SVN server and export all samples to c:\ecl500samples.
     2)Project name type MyFirstPrj, click finish.  
+
    2)Click Import->existing projects, select c:\ecl500samples\w11-basics-simple,
 +
    check copy projects into workspace.
 +
    3)Edit Library.java by adding System.out.println("Hello"); in main.
 +
     4)Click run, and the console will display Hello.
 
   3. Browsing Java elements using the package explorer
 
   3. Browsing Java elements using the package explorer
 
     In the left side of Eclipse, that is the package explorer.
 
     In the left side of Eclipse, that is the package explorer.

Revision as of 16:20, 2 February 2011

Basic Lab:

 1. Preparing Eclipse     
    1)Goto Eclipse from http://www.eclipse.org.
    2)Choose Eclipse IDE for java Developers and download it.
    3)Unzip eclipse to c:\eclipse\Basics folder
    4)Doubleclick eclipse.exe in c:\eclipse\Basics\eclipse
    5)Workspace type ./wksp/lab
    6)Download and install SVN according the instruction at
    http://zenit.senecac.on.ca/wiki/index.php/Basics_:_Install_Eclipse_Plugins
    7)Download JUnit from
    https://github.com/KentBeck/junit/downloads and unzip it to c:\junit4.9b2.
    8)Add junit-4.9b2 to the CLASSPATH, for example:
    classpath=.;c:\junit4.9b2\junit-4.9b2.jar;c:\junit4.9b2
    9)Test if junit is installed correct or not by typing:
    java org.junit.runner.JUnitCore org.junit.tests.AllTests
    If it display ok (508 tests), it means junit is installed correctly.
 2. Creating your first Java project
    1)Open our SVN server and export all samples to c:\ecl500samples.
    2)Click Import->existing projects, select c:\ecl500samples\w11-basics-simple,
    check copy projects into workspace.
    3)Edit Library.java by adding System.out.println("Hello"); in main.
    4)Click run, and the console will display Hello.
 3. Browsing Java elements using the package explorer
    In the left side of Eclipse, that is the package explorer.
    Use mouse to expend MyFirstPrj, you can see src and JRE System Library.
 4. Creating a Java class
    In package explorer, right click on src folder, and select new->class, type student, and click enter key.
    in student.java, type the code. sample code is at
 4. Editing Java elements
 6. Renaming Java elements
 7. Moving and copying Java elements
 8. Navigate to a Java element's declaration
 9. Viewing the type Hierarchy
 10.Searching the workbench
 11.Running your programs
 12.Debugging your programs
 13.Evaluating expressions
 14.Evaluating snippets
 15.Using the Java browsing perspective
 16.Writing and running JUnit tests