Reputation: 1
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?
Upvotes: 0
Views: 1426
Reputation: 5622
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
Upvotes: 0
Reputation: 114817
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.
Upvotes: 1
Reputation: 15189
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:
.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.Upvotes: 0