Configuring Java (with Package) compilation (Javac) and Execution (Java) methods in EditPlus

Source: Internet
Author: User

The premise of the configuration is that the computer has a JDK installed and the relevant environment variables (JAVA_HOME,PATH and CLASSPATH) are configured.

After configuration, enter Javac and Java validation on the command line to verify that the configuration is successful:

Assume that the above scenario indicates a successful configuration.

First open the EditPlus, open the tool-Configure your own definition tool (or use the shortcut key alt+g):

Then click on "group name"to change Group 1 to "Java compilation and execution":

Then click "Add Tool"-"program":


1 Adding a compile function

The contents of "menu text" are changed to "JAVAC"; "Command" Select the compiler JAVAC.EXE in the Bin folder after installing the JDK, assuming the JDK installation path is "C:/JDK", then this path is "C:/jdk/bin/javac.exe" ( Assuming that the system parameter path has been set, here can be directly filled javac); " Select the file name, which is displayed as "$ (filename)". "Initial folder" select "File Folder". Display as "$ (filedir)"; Select the "Capture Output" check box.

( assuming that the "Capture output" checkbox is not selected, the compilation or execution will automatically pop up a command prompt yourself ). Then set to such as the following:

2 Adding a Run function

The contents of "menu text" are changed to "Java"; "Command" Select the compiler JAVA.EXE in the Bin folder after installing the JDK, the path is "C:/jdk/bin/java.exe" (can be directly filled in as JAVA if path is already set); "Parameters" Select "File name (without extension)", which is displayed as "$ (filenamenoext)"; "Initial folder" select "File Folder". Display as "$ (filedir)"; Select the "Capture Output" check box. Then set to such as the following:

This is the end of the main configuration work, the following you can try to write a Java program to test, the compilation of all the information will be displayed in the output form, double-click a row of error messages, EditPlus will actively navigate to the error line.


But. After the above settings are complete. If the package is included in the program, program compilation can pass. However, there is an error in execution, assuming that you need to use EditPlus to compile the program that includes the package, you need to do the following settings, for example:
3 Adding package Java program features
The contents of "menu text" are changed to "JAVAC package". "Command" is filled in as:javac–d."Parameters" selects "File name", which is displayed as "$ (filename)", "Initial folder" select "File Folder", Display as "$ (filedir)". Select the Capture Output check box.It is important to note that. After-D, empty one after another to join.。 Then set to such as the following:
4 adding run with package Java program features
The contents of "menu text" are changed to "Java"; "command" is filled with: Java; "Parameters" selection"Current Selection"。 Add one. Then select "Primary file name (without extension)". That is displayed as "$ (Cursel). $ (Filenamenoext)"; "Initial folder" select "File Folder". Display as "$ (filedir)"; Select the "Capture Output" check box.
After the above settings, EditPlus will be able to compile and run the Java program with the package. However, it is important to note that after compiling the program,Suppose the program is wrapped. The package name needs to be selected first. Then run the "Java Package" command. Then set to such as the following:

This time the configuration is all over, the open tool can see that there are four shortcuts are now the most below. Andshortcut keys in turn are ctrl+1,ctrl+2,ctrl+3,ctrl+4:
Here's a test. Write a Java program with a package and save it in a random location, then compile (Here are two compilations, regardless of whether the Java source file has a package name to use, but note that the compilation has two: Ctrl+1 and ctrl+3,ctrl+1 will be compiled in the current folder to generate a class file, and ctrl+3 after compiling will be based on the package names themselves to generate the corresponding folder. and generate a class file in the innermost layer of the folder), you can see that the display succeeds in the following console: (Note that without package compilation (CTRL+1) source files and class files are under the same folder, it is assumed that the source files and class files with package compilation (CTRL+3) are separate)


Then execute (Note that there are also two implementation, ctrl+2 only in the absence of the package name in the case of the ability to use, and ctrl+4 only in the case with a package name can be enough to use, and pay attention to use must first select the package name, cannot choose more. I can't choose less.), the execution succeeds:
Here is another special case. The execution of our configuration today means that the results after the execution of our compilation do not show up at the command prompt itself. Instead, it is shown in the following console, so there is a special case, that is, what to do if the Java program needs to be entered by the user. We do not enter directly, the method is to right-click on the console and then click on the keyboard input
Of course, assuming that such troublesome words can not be set up and set to No, then the implementation of the time will be actively pop up our familiar command prompt:
Reference website:
Http://jingyan.baidu.com/article/0f5fb099c94f4e6d8334ea82.html
http://blog.csdn.net/cythian/article/details/5936992

Configuring Java (with Package) compilation (Javac) and Execution (Java) methods in EditPlus

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.