How can I export an eclipse 4 application for mult

2019-05-11 16:19发布

问题:

How can I export an Eclipse 4 application so that it can run in either Windows or Linux?

I see that the product configuration has tabs for all platforms:

...but when I export I see in the repository\binary a product with name product_root.win32.win32.x86_64 which indicates that it builds according to my development machine which is Windows 7/64bit.

So to export the application to run in Linux the export must be done in a Linux machine?

I.e. I have to import my project files in an Eclipse running in Linux and then do export?

Update 1:

Following @Baz advice I installed delta pack.
But on export I got the following error:

My settings are the following:

and

So why do I get the error during export?

Update 2:
OK. Had to add the delta pack as part of the Running Platform and not new empty target.

Now the export indeed exports for multiple platforms. Tried for Win/32bit and Win/64 bit.
When I try to run the Win/64 bit (which is also the platform of my PC) all is fine.
But when I try to run the Win/32 bit version I get error that it can not find the jre

Why do I get this error? Am I supposed to bundle the jre? Why does it work for the Win/64 bit? I have not set a JAVA_HOME

回答1:

The easiest way to get your application multi-platform, is to use the Delta-Pack. Here is a great tutorial for using it.

Basically, you download the delta-pack version for your eclipse version, then you configure it to your needs and then you can export your product for each target platform.

Keep in mind, that the contained SWT.jar is platform specific. So you won't be able to run, say the 32bit version on a 64bit JRE system.

Consequently, you will have to provide one jar of your product per target system.