Can't compile/run in Eclipse- Java
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
Jess Anastasio
Updated on May 01, 2020Comments
-
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 about 10 yearsi 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 about 10 yearsokay 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 about 10 yearsYou need to Import your sources to Eclipse project.
-
Marco Roda about 10 yearsSelect the src folder and run: Import... > File System > Next, Browse to the location of your sources, make sure to select them.