Re: [sdljava-users] Problems with JavaSDL.. I've been trying for hours to get this to work.
Status: Beta
Brought to you by:
ivan_ganza
From: Robert S. <the...@gm...> - 2005-02-14 00:08:57
|
Hi Chris, at first I wonder whether this can work: -Djava.library.path=D:/Programming/eclipse/plugins/org.eclipse.swt.win32_3.1.0/os/win32/x86 -Djava.library.path="d:/Java Code/sdljava/lib" You should put both absolute filenames in one argument. On Windows you separate usually with a ; It should look like: -Djava.library.path=D:/Programming/eclipse/plugins/org.eclipse.swt.win32_3.1.0/os/win32/x86;"d:/Java Code/sdljava/lib" --- Exception in thread "main" java.lang.UnsatisfiedLinkError: D:\Java Code\sdljava\ lib\sdljava.dll: Can't find dependent libraries This one looks like sdljava's JNI library (sdljava.dll) cannot find SDL itself. If have no idea how you solve that on Windows elegantly. On GNU/Linux and other Unices we install libraries usually system wide which is less usually on Windows. As a workaround you can download SDL's DLLs from libsdl.org and put them in the same directory as sdljava.dll. cu Robert Chris Dennett wrote: > Hi, I've no idea whatsoever about how to use JavaSDL at all. I > downloaded the win32 compiled version, and I've followed the > instructions in INSTALL, and yet it still isn't working. > > My default VM arguments are > '-Djava.library.path=D:/Programming/eclipse/plugins/org.eclipse.swt.win32_3.1.0/os/win32/x86 > -Djava.library.path="d:/Java Code/sdljava/lib"', and I've added > 'sdljava.jar' to the Libraries section classpath of the Java Build > Path section of the current project. > > My testing code, at the moment, is: > > public static void main(String[] args) { > System.loadLibrary("sdljava"); > try { > SDLMain.init(SDLMain.SDL_INIT_EVERYTHING); > } catch (SDLException e) { > // TODO Auto-generated catch block > e.printStackTrace(); > } > } > > and it is giving me: > > Exception in thread "main" java.lang.UnsatisfiedLinkError: D:\Java > Code\sdljava\ > lib\sdljava.dll: Can't find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(Unknown Source) > at java.lang.ClassLoader.loadLibrary(Unknown Source) > at java.lang.Runtime.loadLibrary0(Unknown Source) > at java.lang.System.loadLibrary(Unknown Source) > at LoachApp.main(LoachApp.java:10) > > However.. if I then remove 'System.loadLibrary("sdljava");', I get the > following message: > > Exception in thread "main" java.lang.UnsatisfiedLinkError: > get_SDL_PRESSED > at sdljava.x.swig.SWIG_SDLMainJNI.get_SDL_PRESSED(Native Method) > at > sdljava.x.swig.SWIG_SDLMainConstants.<clinit>(SWIG_SDLMainConstants.java:12) > > at sdljava.SDLMain.<clinit>(SDLMain.java:37) > at LoachApp.main(LoachApp.java:11) > > If anyone has got this working in Eclipse IDE, could someone guide me > along? Thanks :D > I've attached some screenshots if it helps. > > > ------------------------------------------------------------------------ > > > ------------------------------------------------------------------------ > > > ------------------------------------------------------------------------ > |