Java_web using a simple batch operation

Source: Internet
Author: User

Before the web development of the use of myeclipse, but only used by the people know, because its plug-ins too many, and there are many plug-in functionality is not accessible at all. So, once the project is a little larger will be very card, although it has been optimized before, but still feel that it is not very useful. Having nothing to do today, I decided to try the most primitive way, using Notepad +tomcat to develop. Although the efficiency is not very high, but familiar with the most basic of some operations, it is quite rewarding. In this blog, I will share what I think is the biggest harvest today.

As we all know, we're going to deploy the project in Tomcat, and the. class file that you use needs to be saved to a specific directory (and can also be modified to any directory in Tomcat's configuration file), and the stupidest way is to. After the Java file is compiled, the. class file is copied into the Web-inf subdirectory of the project classes, which has an effect on efficiency. Finally, I tried to use batch processing to solve this problem. Create a new file with the suffix. bat under any directory and use the following statement to generate a simple batch program:

1 set Classpath=e:\bluemsun\tomcat\apache-tomcat\apache-tomcat-7.0.55\lib\servlet-api.jar; %classpath% 2 3 %1 4 5 Pause

The first sentence is to set the environment variables, and we all know that what Tomcat needs is not the system environment variables we set, it relies on the jar packages in the Lib in Tomcat.

The second sentence is to compile the source file using our Javac command, and the-D option means to save our compiled. class file to the directory after it is written, and%1 indicates that our source file is the first parameter.

The third sentence is the pause statement, that is, after the execution of the above two sentences, suspended. The interface displays "please press any key to end" ....

Here is my demo:

1. My classes directory is currently empty,

  

2. Drag the Java source file that you want to compile into Complie.bat:

  

3. Following the completion of the implementation:

  

4. After we go to the classes directory, we can see that the compiled. class file already exists in this directory:

  

Meow ~ is so simple, hehe.

Java_web using a simple batch operation

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.