0

I reinstall my Eclipse environment every year when the new version is released. The most recent release - Juno - however, does not work as expected.

Currently, when I try running demos from Oracle, for example, it asks me to select an Ant file to run before compiling. After creating a blank Ant file to bypass the requirement (which I thought was rather dumb, since I don't think TDD is something that should be forced on people), it still refused to run, saying the "Selection could not be launched."

I understand that Juno is an update from the 3.x track to the 4.x track, but this seems a little ridiculous to me. What can or should I do so I can get Eclipse back up and running again?

Just to clarify:

  • All files in question are on my Eclipse workspace path
  • I don't do much in the way of Java development, though I know I'll need to do so soon. Hence, my unfamiliarity with the most recent version of Eclipse.
  • I would like to run my files & projects without Ant files. I know it has something to do with Run configs, but I don't know how to change them.
Edwin
  • 2,074
  • 1
  • 21
  • 40

2 Answers2

2

Here's what I did to run the demo from Eclipse Juno:

  1. Downloaded the project from http://docs.oracle.com/javase/tutorial/uiswing/examples/zipfiles/components-FrameDemoProject.zip (if this is not the correct demo, then please provide the link you're using)
  2. Unzipped it to my projects directory (not my workspace), so that you have:

    PROJECTS_DIR/components-FrameDemoProject/src

    PROJECTS_DIR/components-FrameDemoProject/nbproject

    PROJECTS_DIR/components-FrameDemoProject/build.xml

  3. From Eclipse, File > New > Java Project

  4. List item Uncheck Use default location and navigate to <PROJECTS_DIR>/components-FrameDemoProject
  5. Hit Finish
  6. Drill down to src/components/FrameDemo.java
  7. Right-click on FrameDemo.java and select Run As > Java Application

Let me know if any of these steps give you trouble.

davidfmatheson
  • 3,539
  • 19
  • 27
  • Not sure why, but hovering over `Run As...` presented no options - at least none that I could click. It worked out after following your instructions, though, and Eclipse no longer gives me any issues when setting up a new project. Thanks! – Edwin Aug 02 '12 at 17:47
0

Take a look at you project properties and select the Builders entry. Do you see an Ant Builder entry? Try to select or create a Java Builder entry instead.

I just created a new Java Project in Juno and added the FrameDemo.java source. In my case, the Java Builder was selected as the default for this new project.

Modus Tollens
  • 5,083
  • 3
  • 38
  • 46