This usually happens after another copy of Eclipse. Previously, the ant script can be normally executed in eclipse. After the original eclipse is deleted, another copy or new version is changed. The following error occurs in the pop-up window when the ant script is executed: ---------------------------
Java Virtual Machine Launcher
---------------------------
Cocould not find the main class. program will exit.
---------------------------
OK
--------------------------- For those who have used Java, do they still understand that ant's main class cannot be found. But to tell the truth, it has plagued me for a while and I have not gone into depth. To put it bluntly, the crux of the problem is that the ant_home point in eclipse is incorrect. Solution: In eclipse, choose Window> preferences> ant> runtime. On the classpath tab, the directory pointed to by ANT home entries is incorrect (it still points to the directory you returned, this directory should not exist.) All you need to do is change ant home to the correct directory. Click the ant Home button and select the ant home directory, for example Eclipse is 3.3.1, and ant home is org. Apache. ant_1.7.0.v200706080842 under the Eclipse plug-in directory. Now you can execute your ant script in eclipse again. Is it normal! |