The most recent time in the project to do is to use a Java program packaged with a bat file to perform this function. On the Internet to find some methods, in order to meet the requirements, need to be in the process of execution, pop-up command Prompt window and not close. So one of the following methods is used.
1, the first is to package the Java source code into an executable jar file. This process can be done with myeclipse. Packaged as a double click on the executable jar file, you need to use the Fatjar plug-in (Eclipse use). Download Address:
http://sourceforge.net/project/showfiles.php?group_id=115990&package_id=125924
After the installation method decompression, the net.sf.fjep.fatjar_0.0.24 folder under the Plugins folder is copied to the plugins under the MyEclipse installation directory, and then the MyEclipse is restarted. This tool makes it easy to package the project in MyEclipse into a jar file.
The steps are: your project =〉build Fat Jar
To make an executable jar, be careful to select the main class. Next
To select a jar package contained in the program, the packaged jar cannot be executed. Finish,ok, you can export the executable jar package.
2. Execute jar file with bat file. Create a new Notepad file, change the suffix name to bat, open with a text editor, and write the following command:
XXX is the name of the jar file you packed out. Note that bat files and jar files are placed in the same directory.
Finally save, double-click the bat file execution, you can. To stop running, just close the line.
Exception in thread "main" Java.lang.noclassdeffounderror:hello,classpath is not configured when an error similar to the following occurs.
Classpath for .; E:\j2sdk1.4.2_04\lib\dt.jar; E:\j2sdk1.4.2_04\lib\tools.jar
Path is E:\j2sdk1.4.2_04\bin;
Java_home for E:\Java\j2sdk1.4.2_04
Classpath his path before must be a bit and semicolon .; That's it..