| Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Developing on Windows, Running on OS X, Help!(NullPointer at Display.updateQuitMenu)
 Goto Forum:| 
| Developing on Windows, Running on OS X, Help! [message #508911] | Wed, 20 January 2010 12:13  |  | 
| Eclipse User  |  |  |  |  | I'm editing this due to getting beyond Crisis 1 and onto Crisis 2. I'm leaving the original problem intact in case it's relevant to Crisis 2. 
 Crisis 2: I got past the segfault by using -XstartOnFirstThread. This got me a bit further, then I ended up getting a Null Pointer Exception at org.eclipse.swt.widgets.Display.updateQuitMenu .
 
 Is there something I need to do/set/configure/futz with on the Windows side to let this (apparently Mac-only, due to NSApplication references in the source) code run properly?
 
 Crisis 1 (Solved?)
 OK. I have developed a Java app which uses SWT rather heavily. I've spent about two days trying to get it to run on a Mac (OS X 10.5.8, Java 1.6). I have overcome several obstacles, including figuring out how to reset JAVA_HOME, writing some bash scripts to set environment variables as needed, and many other things, but I finally hit a wall.
 
 This morning, I got to the point where I got the "Java Link Error" issue, as my code was linked to the win32 jars for SWT. I DL'ed (on my Windows machine) the Mac OSX files, and set SWT_LIB to point to org.eclipse.swt.cocoa.macosx.x86_64_3.5.0.v3550b.jar and swapped the swt.jar I'd been using with the Mac one (keeping both in separate folders, of course). This got me past that hump (when I moved the runnable Jar to the mac), but then I got a segfault, which was, according to the Mac, "possibly due to libswt-pi-cocoa-3559.jnilib plig-in"
 
 I'm sort of reaching a crisis point here, as I need this whole thing working by Friday, and I know there's going to be actual Java code to debug, and I can't even get the front end to come up. (And if my oh-so-clever "Hey, I'll just swap the jars!" solution was, ahem, not so clever, well, I'll take my lumps. What I'd like to avoid, if in ANY WAY POSSIBLE, is installing/configuring Eclipse on two machines, because that magnifies the possibilities of niggling little error ("Oh, this machine uses version 1.3.5.7.8.*9* of ObscureLibYouNeverHeardOf.jar") to suicide-inducing levels.)
 
 Any help is appreciated. If you feel the need to mock my obvious stupidity and cluelessness ("Duh, you just check 'Compile For Mac', moron!"), I don't mind, as long as I get a working answer out of it. Thank you.
 
 [Updated on: Wed, 20 January 2010 15:03] by Moderator |  |  |  |  | 
| Re: Developing on Windows, Running on OS X, Help! [message #509520 is a reply to message #508911] | Fri, 22 January 2010 11:38   |  | 
| Eclipse User  |  |  |  |  | Hi Ian, 
 To point your app at an swt jar, like
 org.eclipse.swt.cocoa.macosx.x86_64_3.5.0.v3550b.jar, you should put the jar
 on the classpath when running it (eg.- at the command line, java -classpath
 ../org.eclipse.swt.cocoa.macosx.x86_64_3.5.0.v3550b.jar <yourClass>.class).
 When the swt jar is loaded it auto-extracts its libraries to a temporary
 location and references them there, no additional effort required on your
 end.  Specifying SWT_LIB overrides this mechanism, which is probably causing
 you problems.
 
 Also, have you seen http://www.eclipse.org/swt/macosx/ ?  Even if you don't
 want to distribute your app as an application bundle, take note of the
 flags -d32/-d64 and -XstartOnFirstThread
 
 If these do not solve your problems then feel free to follow up here.
 
 Grant
 
 
 "Ian Harac" <mrlizard@gmail.com> wrote in message
 news:hj7djn$n0m$1@build.eclipse.org...
 > OK. I have developed a Java app which uses SWT rather heavily. I've spent
 about two days trying to get it to run on a Mac (OS X 10.5.8, Java 1.6). I
 have overcome several obstacles, including figuring out how to reset
 JAVA_HOME, writing some bash scripts to set environment variables as needed,
 and many other things, but I finally hit a wall.
 >
 > This morning, I got to the point where I got the "Java Link Error" issue,
 as my code was linked to the win32 jars for SWT. I DL'ed (on my Windows
 machine) the Mac OSX files, and set SWT_LIB to point to
 org.eclipse.swt.cocoa.macosx.x86_64_3.5.0.v3550b.jar and swapped the swt.jar
 I'd been using with the Mac one (keeping both in separate folders, of
 course). This got me past that hump (when I moved the runnable Jar to the
 mac), but then I got a segfault, which was, according to the Mac, "possibly
 due to libswt-pi-cocoa-3559.jnilib plig-in"
 >
 > I'm sort of reaching a crisis point here, as I need this whole thing
 working by Friday, and I know there's going to be actual Java code to debug,
 and I can't even get the front end to come up. (And if my oh-so-clever "Hey,
 I'll just swap the jars!" solution was, ahem, not so clever, well, I'll take
 my lumps. What I'd like to avoid, if in ANY WAY POSSIBLE, is
 installing/configuring Eclipse on two machines, because that magnifies the
 possibilities of niggling little error ("Oh, this machine uses version
 1.3.5.7.8.*9* of ObscureLibYouNeverHeardOf.jar") to suicide-inducing
 levels.)
 >
 > Any help is appreciated. If you feel the need to mock my obvious stupidity
 and cluelessness ("Duh, you just check 'Compile For Mac', moron!"), I don't
 mind, as long as I get a working answer out of it. Thank you.
 >
 |  |  |  |  |  | 
 
 
 Current Time: Thu Oct 30 20:02:44 EDT 2025 
 Powered by FUDForum . Page generated in 0.30540 seconds |