1

i am currently writing a java program with eclipse on my 64bit Ubuntu laptop. I use a browser from ecplise.swt which has to be 64bit to run in eclipse.

Question is: if i export my program, will it run on an 32 bit linux machine? (specific: Raspbian on a Raspberry Pi)

(side note: I am still having problems with the browser on my ubuntu. question here )

3 Answers 3

4

No, it won't, because the SWT library contains native code. But you can easily replace the 64 bit SWT library by its 32 bit version. Then it will work.

There seems to already exist a pre-built 32 bit SWT for raspberry that you can install via apt-get install. For details see http://www.lucid-control.com/create-raspberry-pi-swt-gui-applications-with-java-and-eclipse/

2
  • 1
    Since the Raspberry Pi runs on an ARM processor (completely different from the Intel x86 or x86_64 CPU on a normal PC), you will need an ARM version of the native library. I don't know if there's an ARM version of the SWT libraries available.
    – Jesper
    Jan 13, 2014 at 13:59
  • Yes, you're right. I've added some information about SWT on Raspberry Pi. I never tested it by myself, but the tutorial looks promising.
    – isnot2bad
    Jan 13, 2014 at 14:15
1

Java programs are not 32 bit or 64 bit. When you compile them, you turn them into byte code that runs on the virtual machine. The virtual machine can be 32 bit or 64 bit just like it can be Ubuntu or Windows.

You should have no problems porting your code.

0

Java depends on the virtual machine so if the 64 bit VM is installed it should be no problem.

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.