☆ Preparation Work
①, the JDK is installed, and the system variables are configured (3, Java_home,path,classpath)
②, the computer has been installed EditPlus, and set up well.
☆editplus Configuring the Java Development environment
For a Java program, we compile its source code file (. java file), then generate a bytecode file (. class file), and finally run the bytecode file to see the results, and
This bytecode file can execute the results in the Java environment under any system. To do this, the Java program is developed in EditPlus, and we also need to configure both the compiled and running environments.
①, configure the previous selection (compile and run the same configuration location)
Open the EditPlus, find the Tools menu (Tool menu), click on it and select the Preferences menu item (Properties/Preferences), at which point a window opens, find tools on the left side of the window,
Tools, find a user tools tool.
Once you have clicked on user tools, you can configure compilation (JAVAC) and Run (Java) on this page
②, configuring the Environment
When you see the window, we can click on the Add Tool>> button (add tool) at the right interface, and the interface appears as shown, we select program item (application), click on the item
When you click Program, the interface changes as follows
Parameter explanation:
Menu text, which is what you want the configured item to appear in the menu.
Command: Commands, select the bin directory of your JDK installation directory javac.exe or Java.exe
Argument: Parameter selection, select File name or include file extension
Initial: From where to start, the general selection starts with the indicated file directory
Action: Refers to the program action, the general choice to capture this action and output in the console
Note: No changes are required for other unspecified. Javac and Java are either uppercase or small.
③, compiling settings
In the text box after the menu text is written on Javac or compile, for your own convenience, I choose Javac,
Click on the following command ... button, select the Javac.exe file under the bin directory in the JDK installation directory, then argument click the Next button to select filename, then initial
Select File directory, the last Action drop-down item to choose Capture Output (capture outputs), and finally click Apply (application), as shown in the parameters, please one by one control.
At this point, the compilation (JAVAC) setting is complete.
④, run settings
The same action, click on the page's Addtools>> button, the settings interface appears, parameter interpretation reference above, here is not explained, here is only how to set.
After the menu Text is written to run or Java, because previously selected Javac in order to be displayed in English, so, here I choose to write Java. On the command item click on the following ... button to select Java.exe lattice
File (because you have previously selected Javac, so it should be done by default in the same directory, directly select Java.exe). Then set argument, click the button on the back, select File Name
Without Extension (does not include an extension), this option is important. Initial still selects file directory, then the action (action) capture output (capture
Output, you can see at compile time on the display of the test results, after running the output of the program results. Click OK at this point. The parameters are configured as shown in
Run (JAVA) settings to this completion
⑤, note
At this point, we can directly click on the Tools menu to see
Click the Javac menu item directly and the software will compile your. java file. class file.
Click the Java menu item directly and the software will execute your. class file and display the results.
The ctrl+1 Ctrl + 2 shown below are the shortcuts they correspond to respectively.
This is also how to compile and run a Java program in the tool.
☆ Developing Java Programs
In EditPlus, click the File menu, select the new option, then select Java in the menu item on the right, click it
At this point, the file is automatically generated as a Java file, the file is not saved and the name is not given.
First, we give a class name after class (the name of the file when it is saved), and then copy the name. For example, the name I gave was wangcai when I copied the name, I clicked Save or
Press CTRL + S, and then locate the folder where the Java practice code is stored, change the file name to Wangcai.java
The file name is consistent with the class name that follows the class. , and then click Save.
At this point, you can click Javac on the Tools menu or press CTRL + 1 to compile the Wangcai.java file.
When you see the software that appears below, it shows that the compilation was successful and there are no syntax errors.
At this point, you can also go to store Wangcai.java folder, you will find a Wangcai.class
When there is no syntax error, click Java in the Tools menu or press CTRL + 2 to run the compiled bytecode file wangcai.class then you will see the software below the console appears hello
world! The result is as shown
OK, so we're done with the development.
At this point, you can modify the contents of the section within the code to further prove it. Let's modify the Hello World within double quotes! Changed to "Thunder, rain, go home to collect clothes!" ", click Save (Ctrl+s)
After saving, compile (ctrl+1) or click Javac under Tools. Run (ctrl+2) or click Java under Tools.
And then we'll see the display in the console
In this way, how to build a Java development environment and develop Java programs in EditPlus is completed.
☆ Small Tips
Every time you modify the content or code in a Java file, you save it. Then recompile and run again. Remember: Run (JAVA) before compiling (JAVAC).
Search for EditPlus shortcut keys. Can improve your encoding speed.
Technology sharing: www.kaige123.com
Developing Java with EditPlus