Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have an old Java app which has been compiled for the 32bit platform. I've moved from Windows XP (32bit) to OS X Snow Leopard (64bit) and I'd like to continue using this app, however I'm getting an exception along the lines of:

Exception in thread "main" java.lang.UnsatisfiedLinkError: 
/Applications/TheApp/lib/libswt-pi-carbon-3139.jnilib:  no suitable image found.
Did find:
/Applications/TheApp/lib/libswt-pi-carbon-3139.jnilib: mach-o, but wrong 
architecture

I've tried using the -d32 switch when running the app from the command line but with no luck.

Is it at all possible to run this 32bit app on a 64bit platform without having to recompile or use a VM?

Edit:

I don't have the original source for this application and I'm not overly familiar with developing in Java. If there is a tool I can use to "up-compile"(?) to 64bit that would be useful!

share|improve this question
2  
You might want to install the 32-bit platform as well (I believe you can install both side-by-side, or it might also include the 32 bit JVM). –  Breakthrough Jan 16 '12 at 12:02
    
if the reason you say you don't wan to recompile it is because you don't have the code, you might be able to decompile it then recompile it. –  barlop Jan 16 '12 at 14:56
    
@Breakthrough: I believe Snow Leopard has both 32 and 64 builds on it. My Java Preferences dialog shows this anyway, and java -version returns "Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02-402, mixed mode)" –  Phillip Oldham Jan 16 '12 at 15:29
1  
Looks like the original program was compiled with some JNI library usage (Wikipedia JNI). With pure java you should have no problems. –  Manwe Jan 20 '12 at 16:47

1 Answer 1

Java is designed to do this kind of thing transparently. Ever heard the slogan Compile once, run everywhere? Well, it's relevant here: Compile once, debug everywhere.

The problem you are seeing is because the GUI is windows specific. The exception you see confirms this. In general, anything that uses SWT or AWT will not work correctly on a different platform unless care is taken to make sure that it does.

Long story short, you're out of luck. You could of course use JD to extract the source and modify the GUI code to run properly on OSX. Unfortunately, that would require some experience with Java.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.