3 Replies - 541 Views - Last Post: 13 May 2011 - 02:28 PM Rate Topic: -----

#1 xEnOnn  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 10-May 11

InvocationTargetException only on Mac

Posted 13 May 2011 - 01:18 PM

I have a small application written in Java on Windows and compiled with Java 1.6. It works fine on Windows. But when I bring it over to my Mac, the application cannot be run. I keep getting a InvocationTargetException error on the console every time when I try to run it:

Exception in thread "main" java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: java.lang.UnsatisfiedLinkError: Cannot load 32-bit SWT libraries on 64-bit JVM
	at org.eclipse.swt.internal.Library.loadLibrary(Library.java:197)
	at org.eclipse.swt.internal.Library.loadLibrary(Library.java:174)
	at org.eclipse.swt.internal.C.<clinit>(C.java:21)
	at org.eclipse.swt.widgets.Display.<clinit>(Display.java:138)




I tried compiling my application in Java 1. 5 instead but I still get the same problem. I also tried to set the default Java AVM on my Mac to 1. 5 and 1.6 but both versions didn't work either. I am running on Mac OS X 1.5.8
I totally have no idea what's wrong since the application runs perfectly fine on my Windows machine.

Thanks for any help.

Is This A Good Question/Topic? 0
  • +

Replies To: InvocationTargetException only on Mac

#2 mi14chal  Icon User is offline

  • D.I.C Head

Reputation: 81
  • View blog
  • Posts: 198
  • Joined: 11-December 10

Re: InvocationTargetException only on Mac

Posted 13 May 2011 - 01:30 PM

Caused by: java.lang.UnsatisfiedLinkError: Cannot load 32-bit SWT libraries on 64-bit JVM Are you using 32-bit library on 64 bit? Try to use 64-bit library.
Was This Post Helpful? 0
  • +
  • -

#3 xEnOnn  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 10-May 11

Re: InvocationTargetException only on Mac

Posted 13 May 2011 - 02:01 PM

How do I compile my current Java application with the 64 bit library? I am using eclipse.
Was This Post Helpful? 0
  • +
  • -

#4 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 9039
  • View blog
  • Posts: 33,531
  • Joined: 27-December 08

Re: InvocationTargetException only on Mac

Posted 13 May 2011 - 02:28 PM

Check out the documentation on the Eclipse website. That link talks specifically about Macs, so it should be a good starting point.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1