简体   繁体   中英

How are Ant vs Eclipse run buttons related?

Hi guys : I'm getting the dreaded "classnotfound" exception in eclipse in an Ant managed project. I notice that there is an "ant" icon right next to my standard green button for running java projects, with very similar options. What is the relationship between these two buttons ?

And a related question : Using eclipse's standard run button, you can click on a class and run it as an individual unit test. Is there a way to do this from the command line in ant.

The "run" button simply starts a new JVM and creates a run configuration where you can configure all kinds of settings (including the classpath). The other button is presumanly "external tools" which does the same for, well, external tools. Ant is the most important one there, so there it allows you to configure ant-specific settings.

But if you get a ClassNotFoundException in ant, then you should add the missing class (the exception text should tell you which) to the classpath within the ant script, not the external tools configuration.

As for unit tests, Ant has a junit task for running them.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM