Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exporting .jar Applet in Eclipse

I have an applet and I can't export it to a runnable jar because it doesn't have a main class( public static void main(String args[]) ) I need a runnable jar because I have a program that has many classes and packages. How do I make this work. If the answer is adding a main method what do I put in the main method?

Update I tried to use a normal .jar but still nothing. Here is a reply i sent to better describe what is happening

"I still get the class not found error. I have a .jar that has a "main" folder. Then in the "main" folder I have all my classes. My main class is Render.class so in html i use this code to open the applet: "

like image 878
36redsoxfan Avatar asked Jul 06 '12 00:07

36redsoxfan


People also ask

How do I export a JAR file from Eclipse?

To export your project, right-click it and select Export. Select Java > Runnable JAR file as the export destination and click Next. On the next page, specify the name and path of the JAR file to create and select the Launch configuration that includes the project name and the name of the test class.

What is runnable JAR file in Eclipse?

A runnable jar is a jar file that has an embedded Manifest file that includes the "Main-Class:" declaration.

How do I export a class from a JAR file?

Select the Java extension classes, right-click and select Export from the context menu as shown in the following screen shot: The Export dialog box opens. Select the JAR file and click Next as shown in the following screen shot: The JAR Export File Specification dialog box opens.


1 Answers

If it's an applet it isn't a 'runnable jar'. Luckily, you don't need one. You just need an ordinary jar. Eclipse will make one of those.

like image 164
bmargulies Avatar answered Oct 26 '22 22:10

bmargulies