Java Lab report One: Familiarity with the Java development environment

Source: Internet
Author: User

Experimental requirements:

1. Compiling and running a simple Java program using the JDK

2. Edit, compile, run, and debug Java programs using Eclipse

Experimental content

(i) Java program Development under command line

(ii) Development and commissioning of Java programs under Eclipse

(iii) exercises (implemented via command line and Eclipse two, practice debugging under Eclipse)

3. Implement the Caesar password and test

Experimental process

Experiment One:

Open the command line through the Xface software by running the window, via the command line, by gedit the file name. java, or vim file name. Java, into the Java program's codec interface.

After writing the code saved, pass the javac-d. File name. java compiler program. Enter Java Scn.hello to run the compiled program.

Experiment Two:

Programming with Eclipse. Note To save the established class to the package folder. Write the development process. Focus on debugging the program, click Window->Open Perspective->Debug Open Debug View.

Set breakpoints, and in front of where you want to set breakpoints, double-click the section that precedes the number of rows to set breakpoints quickly.

debugging shortcut keys are F11, single-step debugging, enter the function shortcut key is F5, do not enter the function shortcut key F6, general debugging do not enter the function, when the function problem, then enter the function.

To debug at a specified location, use the Resume function of the shortcut key for F8.

You can view the value of a variable at this time by moving the mouse over the variable.

Conditional breakpoints, which are typically used in loop statements. Right-click to the left of the statement line you want to debug, and select Breakpoint Properties...”, Enter the required loop condition.

Experiment three: Implement Caesar's password and test it

The problems encountered in the experiment and the solving methods

Experiment One:

You cannot run the program after you have written it, because you set up a package, you should enter javac-d. file name. java.

Experiment Two:

Open with the command line like the previous version, if you double-click directly on the desktop, the open version has a higher hierarchy, not directly build Java project.

Through the experiment, no other technical problems were encountered during the experiment.

There's no problem with experiment three.

Experimental Harvest

I learned how to write Java files in the command line and learned to debug programs in Eclipse .

Java Lab report One: Familiarity with the Java development environment

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.