Something weird is happening.
I made a new project in Eclipse and coded for a while. With four classes, one of them containing a main method, all four in a package, I was ready for a first test run. When I hit Ctrl+F11 (Run), a message came up, something like the following:
Selection does not contain a main method.
So I head over to the Run configuration, and I find that no main class is set. When I hit the corresponding 'search' button in order to specify the main class, the dialog that came up was empty. The dialog worked fine, but there were no classes for me to choose from.
The files are in the correct location both in the project and in the hard drive. The selected project in the Run configuration is also the right one.
I tried switching between JRE's, but nothing. Restarting Eclipse or refreshing the project is useless, too. If I manually type the name of the class (Main) it just tells me that class Main was not found when I try to run it. I also tried moving the class to another package.
I've made several projects with this installation of Eclipse in this same computer. The first run fails sometimes, but fiddling with the Run configurations always fixes it quite easily. This time it seems as though I'm doomed to never run this program. Maybe the project was a bad idea in the first place...
Has anyone run into this problem before? Am I missing the most stupid thing just in front of my eyes?
Something weird is happening.
I made a new project in Eclipse and coded for a while. With four classes, one of them containing a main method, all four in a package, I was ready for a first test run. When I hit Ctrl+F11 (Run), a message came up, something like the following:
Selection does not contain a main method.
So I head over to the Run configuration, and I find that no main class is set. When I hit the corresponding 'search' button in order to specify the main class, the dialog that came up was empty. The dialog worked fine, but there were no classes for me to choose from.
The files are in the correct location both in the project and in the hard drive. The selected project in the Run configuration is also the right one.
I tried switching between JRE's, but nothing. Restarting Eclipse or refreshing the project is useless, too. If I manually type the name of the class (Main) it just tells me that class Main was not found when I try to run it. I also tried moving the class to another package.
I've made several projects with this installation of Eclipse in this same computer. The first run fails sometimes, but fiddling with the Run configurations always fixes it quite easily. This time it seems as though I'm doomed to never run this program. Maybe the project was a bad idea in the first place...
Has anyone run into this problem before? Am I missing the most stupid thing just in front of my eyes?
0 commentaires:
Enregistrer un commentaire