0

I have created an eclipse plug-in project that runs correctly and that can be deployed to a windows exe. However I need to be able to run this application on other platforms, so I would like to generate an executable .jar file of the application. The problem is that I have searched everywhere and all the methods of doing this require a "Main" class that contains a main method to be provided. Because my project is a plug-in project it makes use of an "Application" class that is generated by eclipse to kick start the application, and therefore does not contain a "Main" class that can be referenced. If i neglect to reference it a jar gets generated, but it won't run because it gets the "Failed to load Main-class manifest attribute" error.Is there a way to get around referencing a main class to create an executable jar?

1
  • Deploying a plugin to an exe? Do you have written an rich client application? Or what have you did? May 19, 2011 at 12:25

3 Answers 3

1

The idea doesn't help, because the "eclipse.exe" is not the only OS-dependent file in your distribution: the SWT libraries can't be used on other platforms too.

With eclipse you'll have to build your application for different platforms from within eclipse.

0

It's not exactly clear to me what you want to accomplish. A plug-in by its very definition can't run on it's own. You always need the framework in order to execute it. Basically you can do two things:

  1. If you intend to distribute the plug-in for others to use, you can export the plug-in from the Overview tab of the plugin.xml editor.
  2. If you want to run the plug-in on its own in an instance of the Eclipse platform, you have to create a .product file that describes which plug-ins your application needs, what its name is, splashscreen etc. Eclipse has an editor that helps you setting up that file. This creates a platform specific launcher with which you can easily run the application on the desired platform. Depending on your target platform you might need to install a delta pack.
0
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.8.2
Created-By: 1.6.0_22-b04 (Sun Microsystems Inc.)
Class-Path: 
X-COMMENT: Main-Class will be added automatically by build
Main-Class: javaapplication2.JavaApplication2

in your jar "META-INF" create folder name file MANIFEST.MF append above content point your main class file

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.