Title: How can I run a java class as an applet in Eclipse?
Tags: java;eclipse
Question: How do I run a java class as an applet in Eclipse, I don't want to run the applet in a browser.
I just want to run it in Eclipse with AppletViewer. I have a .class file but it won't run.
Comment: I right click on the class file, go to "Run As", and there is no option to run it as an applet or application. If I hit the green arrow to run, nothing happens either.

Comment: `I have a .class file but it won't run.` -- How are you trying to run it?  What error do you get when you try to run it?


Here is another answer: In eclipse you shouldn't try to interact directly with the generated files (such as .class files).  There's a reason that it hides them from you by default in the most views.
Instead find the .java file which contains the class which extends Applet and go into its "Run As" menu.  You should have the option to run it as a "Java Applet".
Comment for this answer: Oh okay, so there is no way to run just a class file (even on something other than Eclipse)? I don't have the java file.
Comment for this answer: Well, I suppose you can pull the .class file in as a resource (see [this question](http://stackoverflow.com/questions/661110/how-do-i-include-class-files-in-my-project-in-eclipse-java/661143#661143) and then write your own class which uses it and run *that*.  Keep in mind that eclipse is a compiler, it really expects you to have the source code, so things are going to be much more convoluted when you don't.

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 2, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2015:00:06/26/15', 'FavoriteCount': 1.0, 'PostTypeId': 1, 'Tags': '<java><eclipse>', 'Title': 'How can I run a java class as an applet in Eclipse?', 'ViewCount': 855, 'id': 31077003, 'user_AboutMe': None, 'user_AccountId': 6533162.0, 'user_DisplayName': 'Jon', 'user_Reputation': 11.0, 'user_Views': 2.0, 'user_id': 5053692.0}}