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?
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.
I had the same issue I resolved by:
src
folder and run.It will work.
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.
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.
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.
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.