5YrsLaterDBA
5YrsLaterDBA

Reputation: 34770

build for 64bit, 32bit, windows and linux

We started from 32bit windows. The Java application will be packed with JRE and use this packed JRE. Now we need to support 64bit and linux. I am looking for a way to create releases for them. Is there any difference between the following two options:

Option 1:

Build the source with 32bit windows JDK (in a 32bit windows machine) and pack different JRE for 32bit/64bit and Windows/Linux;

Option 2:

Build with corresponding JDK for 32bit/64bit and/or windows/Linux (that is build 64bit windows application with 64bit windows JDK)

Option 1 is simpler in release process but I don't know is there any potential issues (error, performance). Option 2 may require 4 different machines just for the release.

Anyother question is what will happen if I build a Java application with 64bit JDK and run it in a 32bit machine with 32bit JRE? I will find a machine to try it out later.

Upvotes: 1

Views: 319

Answers (3)

user1178729
user1178729

Reputation:

You can exec a command line command specifying the amount of RAM used depending on the architechture

Upvotes: 0

Dev
Dev

Reputation: 12206

The transformation of java source to bytecode with javac is architecture independent. Meaning option 1 should be fine.

Upvotes: 3

jtahlborn
jtahlborn

Reputation: 53694

compiled java code is not specific to any architecture. you can compile it once on any computer and distribute it as is (pairing it with an appropriate jre if need be).

Upvotes: 4

Related Questions