How can I export an eclipse 4 application for multiple platforms
Asked Answered
M

1

3

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:

enter image description here

...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:

enter image description here

My settings are the following:

enter image description here

and

enter image description here

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

Manservant answered 20/10, 2012 at 12:42 Comment(6)
Have a look at this: Export for multiple platforms via the deltapackKizzie
@Baz:In the link the Click on the release for are interested in, e.g. 4.2 what does it refer to?The eclipse installation I currently have during development?Manservant
It means that you should go to the linked eclipse download page and select the eclipse version you have installed. Then you should get to a page where you can download the "Delta Pack" for that eclipse version.Kizzie
@Baz:Please see update OP after your suggestionManservant
@Baz:See only update 2 please if you have timeManservant
So you can run the 64bit version, but not 32bit. That is absolutely correct, if your OS is 64bit. You will need a 32bit JRE to run your 32bit exported Jar. Similarly, you won't be able to run the Jar for Linux or Mac on your 64bit windows ;) The included SWT.jar is platform specific, so you will have to create a jar for each platform.Kizzie
K
2

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.

Kizzie answered 22/10, 2012 at 6:41 Comment(4)
I did that,but in order to work I had to modify the Target Runtime.I am not sure how this is usedManservant
Link looks like it no longer contains information about Delta-Pack. Better: vogella.com/tutorials/EclipseProductDeployment/article.htmlVasos
Delta packs seem to have become an obsolete tool. The Eclipse wiki states that the problems they solve can be solved using P2 update sites instead.Gyve
@Gyve Well, the answer is 5 years old. You could create a new answer and explain how to do it with P2 so that people visiting this in the future know what to do.Kizzie

© 2022 - 2024 — McMap. All rights reserved.