EditPlus how to compile and debug JAVA programs __java

Source: Internet
Author: User

Java needs to be installed, the environment must be built well

After installing the Java JDK, set it in the system variable block:

New system Variable:

Variable name: [java_home]

Variable value: [C:\Program files\java\jdk1.7.0_51]

Special Note: My JDK is installed in this location C:\ProgramFiles\Java\jdk1.7.0_51 so just fill this out and fill out what your own JDK is installed in.

within the system variables find Path Selection Editor: At the end add ;%java_home%\bin;

To verify that the environment variable is configured successfully:

Run cmd command

And then enter Java-version

If the version number is displayed, then your computer can run the Java program.


Before configuring EditPlus is to install and debug the Java operating environment first, then enter the EditPlus, from the menu "tools"; "Configure user Tools ..." Go to User tool settings, select "Group 1" in "Groups and Tools Entries", click the "group name ..." button on the right side of the panel, modify the text "group 1" to "Java compiler", click the "Add Tool" button, select the application,
Then you modify the attributes:
  1. Add Compile function
The contents of the menu text are modified to "Javac", and the command selects the compile-path Javac.exe in the bin directory after the JDK is installed, and my JDK installation is "D:\JDK (Java installed) \", then this path is "D:\JDK (Java installation) \ Bin \javac.exe ";
"Parameters" select "FileName", which is displayed as "$ (filename)";
"Initial directory" select "File directory", display as "$ (filedir)", select the "Capture Output" checkbox, click OK button.


 2. Add Executive function
The content in the menu text is changed to "Java";
Command selects the compiler Java.exe in the bin directory after the JDK is installed, with the path "D:\JDK (Java installation) \bin\java.exe";
"Parameter" select "FileName without extension", which is displayed as "$ (filenamenoext)";
"Initial directory" select "File directory", display as "$ (filedir)"; Do not select the Capture output check box. Otherwise, the command console is not ejected. Then click the OK button.


This completes the basic setup of EditPlus, you can write a Java program to debug, compile by ctrl+1, use ctrl+2 to run the program , Error prompts will appear in the Output window, double-click a line of error messages, EditPlus automatically navigates to an error line, a simple Java IDE interface appears.

Run a simple applet below:

public class He
{
public static void Main (string[] args)
{
int A;
int sum=0;
for (a=1;a<=100;a++) {sum+=a;}
System.out.println ("1+2+3+4+....+100=" +sum);
}
}

ctrl+1 for compilation

 

ctrl+2 Run the program

The files in the catalogue are shown below


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.