Cannot Run a Java application on Eclipse

Hi,

If any of you have used eclipse, please let me know what this error means.
I am running an open source code - dtdparser
I tried to run it in eclipse and it compiles fine but at runtime gives the following error in a dialog box:
The active editor doe snot contain a Main type

When I checked the file ClassGenerator.java

It has the main method.

Any thoughts?

Oh and By the way after I build it, its not showing me the class file.
Does it store it in a separate bin directory or something?

Please lemme know
dkamdarAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

RMaruszewskiCommented:
> Oh and By the way after I build it, its not showing me the class file.
> Does it store it in a separate bin directory or something?

It depends how you configure your project. You can set the "bin" directory, it's the common practice.
But by default the compiled files (.class) are created in the same directories where source files (.java) are located.
0
fifaloverCommented:
Open the properties for your project. Go into the Java Build Path and in there you can specify the folders in your project to compile (that's what is in the "Source folders on build path") and the output for all the class files ("Default output folder"). If you've put your code into folders in your project that aren't part of the package name, make sure they are listed as a source folder. If you need to have any JAR files in your classpath when compiling, switch to the Libraries tab and add them there.

For example, I'm working on something I've checked out from a CVS repository. It has more than just the source code in there, so the source code is in the /implementation/source folder. Then beneath that are the folders that correspond to the package names. For Eclipse to compile this project I had to change the source folder it was compiling. It was trying to compile from the root directory, which didn't work since the package names didn't start with implementation.source. Once I did that it compiled just fine and I changed the output path to /implementation/build to tell it where to put the class files.

As long as that all checks out, just make sure that main method is static. I've goofed on that before myself when I was in a rush to write something.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.