可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
I am new to jav/Eclipse.
I installed eclipse and working on a JAVA 1.4 file using it as an IDE.
I made my code changes and saved it and wanted to Run (cntr F11) or debub (F11)
every time i am getting
select what to run
Ant Build
Ant Build..
what is this Ant Build ?
How to rectify /connect/ Ant Build?
Ant Build has turned a sort of raod block for me vis a vis running the file.
How to Run my file with out getting Ant road blocks?
回答1:
I had the exact same problem, where when I clicked "Run" I would get a menu with options of "Ant Build" or "Ant Build..." -- even though I had a main method.
I finally got my program to run as normal when I copied and pasted my code into a new file in a new project folder. I deleted the old file altogether, along with its source folder.
When I created the new class, I selected the option "Use project folder as root for the sources and class files" instead of creating separate folders.
Then, when I clicked "Run", I got some peculiar output the first time that I didn't understand. The second time, however, I got all my programs running as they used to.
I'm not exactly sure what these actions did to solve the problem, as I, too, am a novice programmer. But I'm getting my information from http://www.daniweb.com/software-development/java/threads/199459/simple-java-applet-wont-run-on-eclipse#.
Hope this helps.
回答2:
The Java file needs a main method for eclipse to offer you the option to run as a Java application. Otherwise it gives other options such as run on server or run as Ant build and so on.
回答3:
You can use Ant to build your project, generate docs from inline javadocs, check for coding standard violation, run tests and such. You can use it with a version control system and/or continous integration system together.
Apache Ant
Cruise Control ci system
回答4:
You don't need an ANT build to test run a simple Java application. Here's what I do:
With the java source file open, click on the down-arrow next to the green run button on the tool bar. Then choose the run button in the drop-down like this:
alt text http://tracyprobst.com/SOImages/EclipseRun1.JPG
There is probably a menu option or function key to get there, but I never learned it.
On the resulting screen, click the button on the top left corner to launch a new configuration. Here you can supply things like arguments or set a special classpath that's different than your project configuration.
Then click the RUN button on the bottom of the dialog and it will run your code. Once you have the run configuration defined, you don't need to define it again for that particular class. The Debug button and Run button are the toolbar share the same run configurations.
回答5:
1.Compiling the code
2.Packaging the binaries
3.Deploying the binaries to the test server
4.Testing the changes
5.Copying the code from one location to another
To automate and simplify the above tasks, Apache Ant is useful. It is an Operating System build and deployment tool that can be executed from the command line.
回答6:
I got this problem too.
For example it happend to me because I wrote the code in NetBeans then I tried to run it with Eclipse.
First pop-up was:
then it showed up this Error:
The easiest solution for me was to copy and paste my class into a new one created in Eclipse.
No other Errors showed up and the code ran at first attempt.
回答7:
I had the same issue I resolved by:
- creating a new Java project in the workspace you are using.
- create a new class within your project.
- copy your code into your
src
folder and run.
It will work.
回答8:
(Go to Project Menu and Remove check mark from Build Automatically) Check this option first, it gave me whole a lot of Headache REMOVE Check mark!
Click here for image if you can not find it