Beijing Institute of Electronic Technology (BESTI)
Lab Report
Course Name: Java Programming Experiment class: 1352 Name: Hong Military Study No.: 20135219
Score: Instructor: Lou Jia Peng Experimental Date: 2015.04.14
Experiment level: Preview degree: Experiment time:
Instrument Group: Compulsory/Elective: Elective experiment number: 01
Lab Name: familiarity with the Java development environment
Experimental purposes and requirements:1. Compile with JDK and run a simple Java program.
2. Edit, compile, run, and debug Java programs using Eclipse.
, &NB Sp , &NB Sp  &NBS P;
, &NB Sp , &NB Sp  &NBS P;
Experimental instrument:
Name |
Model |
Number |
Pc |
Mac |
1 |
Experimental steps:
Write the code at the command line and compile the run:
1. Open the terminal and enter CD Code,mkdir 20135219 to set up the experiment directory.
2. Enter Gedit Hello.java, edit Hello.java as follows:
3. Enter javac-d. Hello.java Compile the code and enter Java Ph. Hello run the program, the result is as follows:
Second: Under Eclipse Java program development, debugging:
1. On the command line, enter Eclipse command to open Eclipse.
2. New project, package, class Hellojdb.java
3. Enter the code and run the results as follows:
4. Open the Debug view via Windows->open Perspective->debug, as shown in
5. Set breakpoints for debugging with the following results:
Third, Exercise:
5. The solid line 1-n the function of all prime numbers between the integers and is tested.
Code and running results:
Four, PSP statistics:
Steps |
Take |
Percentage |
Demand analysis |
2min |
10% |
Design |
3min |
14% |
Code implementation |
5min |
24% |
Test |
3min |
14% |
Analysis Summary |
8min |
38% |
V. Problems encountered and solutions:
1. Problems encountered:
Error during code completion first run
2. Workaround:
Through the error prompt and the code check repeatedly, found that the file name is different from the class name, the other is a spelling error, after correcting the code can run normally.
3. Analysis and Summary:
In the future study and practice, should pay attention to the details of the problem, while mastering the use of Eclipse Debugging program methods.
Java First Experiment Report--java development environment familiarity