Can't compile/run in Eclipse- Java

52,550

First make sure that you made a regular "Java Project", and not something else.

If there's something wrong with the build configuration, which i guess there is, go to: Run > Run Configurations... On the left you will see a list of configurations, make sure your configuration runs as a "Java Application". If not, delete all the configurations by selecting them and then press delete.

If things are fine, your program should run normally

Share:
52,550
Jess Anastasio
Author by

Jess Anastasio

Updated on May 01, 2020

Comments

  • Jess Anastasio
    Jess Anastasio about 4 years

    I'm trying to compile and run a simple program in Eclipse and whenever I hit run it says select what to run: and theres the option of two ant builds I have no clue what ant builds are or what to do about that.. when i try to run with the ant build it says "build failed: could not find an ant file to run" I have the newest version of java and everything should be working fine but when I can never get past the ant build problem.

    Thanks for any advice!

  • Jess Anastasio
    Jess Anastasio about 10 years
    i originally created these java files on a different computer using dr java... they are .java files and should run.. i didn't create them in eclipse could that be an issue?
  • Jess Anastasio
    Jess Anastasio about 10 years
    okay after following that way of doing it that worked. how can i get my existing java files that i created on dr. java ide to work on eclipse?
  • Marco Roda
    Marco Roda about 10 years
    You need to Import your sources to Eclipse project.
  • Marco Roda
    Marco Roda about 10 years
    Select the src folder and run: Import... > File System > Next, Browse to the location of your sources, make sure to select them.