Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+19 votes

Whenever I try to run a code in eclipse it asks me to run it through ant build and when I do it it does not work.

asked in CSC211_Winter2018 by (1 point)

3 Answers

+14 votes

I have the same problem sometimes. I think it means that whatever file you're trying to run is not a valid class and won't run it. What works for me is making a new class and copying my work into the new class.

answered by (1 point)
+13 votes

A couple possibilities:

  1. Maybe your .java file is not inside the src folder?
  2. Maybe you created a generic "Project" instead of a "Java Project" in Eclipse?
  3. Something else that I'm not thinking of right now...
answered by (3.5k points)
+8 votes

I'm thinking that it might have something to do with if you say yes to "create modules" or whatever when eclipse asks you that when you first create a new class

answered by (1 point)
...