Before the use of the Web development is myeclipse, but only used people know that because of its plug-ins too much, and there are many plug-ins do not touch the function. So, once the project is a little bit larger will be very card, although it has been optimized before, but still feel less useful. Today, there is nothing to do, decided to try the most original method, using Notepad +tomcat for development. Although the efficiency is not very high, but familiar with the most basic of some operations, is quite rewarding. And in the blog, I will share what I think is the biggest harvest of 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 (or, of course, 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 to the Web-inf subdirectory of the project classes, which is effective. Finally I tried to use batch processing to solve this problem. Under any directory, create a new file with a suffix named. bat, and use the following statement to generate a simple batch program:
Copy Code code as follows:
Set classpath=e:\bluemsun\tomcat\apache-tomcat\apache-tomcat-7.0.55\lib\servlet-api.jar;%classpath%
javac-d E:\bluemsun\tomcat\apache-tomcat\apache-tomcat-7.0.55\webapps\mm\WEB-INF\classes%1
Pause
The first sentence is to set the environment variable, and we all know that Tomcat needs more than the system environment variable that we set up, and it relies on the jar package from 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 written later, 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 shows "Press any key to end" ....
Here's my demo:
1. My classes directory is currently empty,
2. Drag Java source files that need to be compiled into Complie.bat:
3. Following completion of 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.