Thread: [Sablevm-user] jni: LD_LIBRARY_PATH ignored
Brought to you by:
egagnon
From: Mark H. <mh...@ti...> - 2003-03-20 14:51:19
|
Hi, I'm trying to use sablevm 1.0.8-3 (Debian) on a project which uses JNI. The location of the libraries is being set using the LD_LIBRARY_PATH environment variable. sablevm doesn't seem to be picking up on this. The follow exception is produced: java.lang.UnsatisfiedLinkError: Could not find library GTKJava. at java.lang.Runtime.loadLibrary(Runtime.java:682) at java.lang.System.loadLibrary(System.java:620) at org.gnu.gtk.Gtk.static{}(Gtk.java:96) at java.lang.Class.step8(Class.java) at java.lang.Class.initialize(Class.java:204) at com.tildemh.debbuggtk.BugWatcher.main(BugWatcher.java:454) at java.lang.VirtualMachine.invokeMain(VirtualMachine.java) at java.lang.VirtualMachine.main(VirtualMachine.java:88) How can I fix this? Please CC me - I'm not on this list. -- .''`. Mark Howard : :' : `. `' http://www.tildemh.com `- mh...@de... | mh...@ti... | mh...@ca... |
From: David <db...@cs...> - 2003-03-21 05:31:40
|
Mark, You can specify it with the java.library.path property as follows: sablevm -p java.library.path=3DDIR ... I noticed this also. The reason is that Classpath code uses that property instead of the LD_LIBRARY_PATH env var. I am not sure if this is a Classpath/SableVM bug since libraries are located in a "system-dependent" way. It might be more of an annoyance than a bug but I will leave this for discussion on the developer's mailing list. David On Thu, Mar 20, 2003 at 02:42:26PM +0000, Mark Howard wrote: > Hi, > I'm trying to use sablevm 1.0.8-3 (Debian) on a project which uses > JNI. The location of the libraries is being set using the > LD_LIBRARY_PATH environment variable. sablevm doesn't seem to be pickin= g > up on this. The follow exception is produced: > java.lang.UnsatisfiedLinkError: Could not find library GTKJava. > at java.lang.Runtime.loadLibrary(Runtime.java:682) > at java.lang.System.loadLibrary(System.java:620) > at org.gnu.gtk.Gtk.static{}(Gtk.java:96) > at java.lang.Class.step8(Class.java) > at java.lang.Class.initialize(Class.java:204) > at com.tildemh.debbuggtk.BugWatcher.main(BugWatcher.java:454) > at java.lang.VirtualMachine.invokeMain(VirtualMachine.java) > at java.lang.VirtualMachine.main(VirtualMachine.java:88) >=20 > How can I fix this? >=20 > Please CC me - I'm not on this list. > --=20 > .''`. Mark Howard > : :' : > `. `' http://www.tildemh.com=20 > `- mh...@de... | mh...@ti... | mh...@ca...=20 >=20 >=20 >=20 > ------------------------------------------------------- > This SF.net email is sponsored by: Tablet PC. =20 > Does your code think in ink? You could win a Tablet PC.=20 > Get a free Tablet PC hat just for playing. What are you waiting for?=20 > http://ads.sourceforge.net/cgi-bin/redirect.pl?micr5043en > _______________________________________________ > Sablevm-user mailing list > Sab...@li... > https://lists.sourceforge.net/lists/listinfo/sablevm-user --=20 --- David B=E9langer Graduate Student School of Computer Science McGill University Office: MC226 Web page: http://www.cs.mcgill.ca/~dbelan2/ Public key: http://www.cs.mcgill.ca/~dbelan2/public_key.txt |
From: Grzegorz B. P. <ga...@de...> - 2003-03-21 08:56:38
|
W liście z pią, 21-03-2003, godz. 06:31, David Bélanger pisze: > Mark, > > You can specify it with the java.library.path property > as follows: > > sablevm -p java.library.path=DIR ... > > > How can I fix this? > I think that it could be added to /usr/lib/sablevm/bin/java wrapper quite easily. I'll add this to the next version of package *IF* LD_LIBRARY_PATH is the standard way of telling where to look for jni libs. David or anyone - can you tell me how should I use the java.library.path property when I have more than one directory in LD_LIBRARY_PATH? Shall I use "-p" multiple times? or only once but separate the dirs with some separator? (which one? ":" ?) Cheers, Grzegorz B. Prokopski -- Grzegorz B. Prokopski <ga...@de...> Debian http://www.debian.org/ |
From: Mark H. <mh...@ti...> - 2003-03-21 13:50:56
|
On Fri, 2003-03-21 at 08:55, Grzegorz B. Prokopski wrote: > I think that it could be added to /usr/lib/sablevm/bin/java wrapper > quite easily. I'll add this to the next version of package *IF* > LD_LIBRARY_PATH is the standard way of telling where to look for > jni libs. LD_LIBRARY_PATH seems to work in gij, kaffe and Blackdown Java. I think it's a standard unix way of modifying the library path. I've also just noticed that sablevm doesn't check /usr/lib either. This is usually checked as default in most JVMs. -- .''`. Mark Howard : :' : `. `' http://www.tildemh.com `- mh...@de... | mh...@ti... | mh...@ca... |
From: David <db...@cs...> - 2003-03-21 14:26:00
|
On Fri, Mar 21, 2003 at 09:55:29AM +0100, Grzegorz B. Prokopski wrote: > W li?cie z pi?, 21-03-2003, godz. 06:31, David B=E9langer pisze:=20 > > Mark, > >=20 > > You can specify it with the java.library.path property > > as follows: > >=20 > > sablevm -p java.library.path=3DDIR ... > >=20 > > > How can I fix this? > >=20 >=20 > I think that it could be added to /usr/lib/sablevm/bin/java wrapper > quite easily. I'll add this to the next version of package > *IF* > LD_LIBRARY_PATH is the standard way of telling where to look for > jni libs. >=20 > David or anyone - can you tell me how should I use the java.library.pat= h > property when I have more than one directory in LD_LIBRARY_PATH? > Shall I use "-p" multiple times? or only once but separate the dirs > with some separator? (which one? ":" ?) >=20 Grzegorz, The right way to do it is to use the ':'. (Actually, it uses the propert= y path.separator which defaults to ':' and should be defined as ':' on *nix system anyway). Properties are simple (key,value) pairs. There cannot be several pairs stored with the same key. I am not sure what SableVM does if one is specified several times. It might just use the last value? The actual code that uses it is in: sablepath-classes/src/java/lang/Runtime.java especially Runtime() and loadLibrary(). David --- David B=E9langer Graduate Student School of Computer Science McGill University Office: MC226 Web page: http://www.cs.mcgill.ca/~dbelan2/ Public key: http://www.cs.mcgill.ca/~dbelan2/public_key.txt |
From: Prof. E. M. G. <eti...@uq...> - 2003-03-21 15:29:44
|
David B=E9langer wrote: > Properties are simple (key,value) pairs. There cannot be several pairs= > stored with the same key. I am not sure what SableVM does if one > is specified several times. It might just use the last value? All command-line properties (e.g. "--property=3D...") are passed to the c= lass-library. In sablevm-class-library, src/java/lang/Runtime.java: =2E.. private static void insertSystemProperties(Properties p) { =2E.. // get command-line passed value. These values may override // default values above. int count =3D getPropertyCount(); for (int i =3D 0; i < count; i++) { String property =3D getProperty(i); int equal_position =3D property.indexOf('=3D'); String name =3D property.substring(0, equal_position); String value; if (equal_position < property.length()) { value =3D property.substring(equal_position + 1); } else { value =3D ""; } p.setProperty(name, value); } =2E.. So, if you pass the same property many times, p.setProperty(name, value) = will be=20 called appropriately. The semantics of java.util.Properties indicate tha= t only=20 the last assigned value will be retained. As you see, I like to keep the native code to a minimum, in SableVM. I t= ry to=20 do as much as I can in Java. When you modify SableVM, try to do the same= =2E [I=20 know David already does this:-)] Etienne --=20 Etienne M. Gagnon, Ph.D. http://www.info.uqam.ca/~egagnon/ SableVM: http://www.sablevm.org/ SableCC: http://www.sablecc.org/ |
From: Mark H. <mh...@ti...> - 2003-03-21 13:50:50
|
On Fri, 2003-03-21 at 05:31, David Bélanger wrote: > sablevm -p java.library.path=DIR ... Thanks for your reply. Unfortunately I'm now getting a different error. sablevm: INTERNAL ERROR (source file "native_interface.c", line 24443): todo Aborted I guess this is just unfinished code, so there's little I can do but wait. [Please CC me - I'm not on the list] -- .''`. Mark Howard : :' : `. `' http://www.tildemh.com `- mh...@de... | mh...@ti... | mh...@ca... |
From: Prof. E. M. G. <eti...@uq...> - 2003-03-21 15:38:31
|
Mark Howard wrote: > Thanks for your reply. Unfortunately I'm now getting a different error. > sablevm: INTERNAL ERROR (source file "native_interface.c", line 24443): > todo > Aborted > I guess this is just unfinished code, so there's little I can do but > wait. Ah! You're using GetByteArrayRegion. This is easy enough to add. Could you send the list of the JNI functions your native library is calling. I know, SableVM should implement all of them, but I had a thesis to finish first... Right now, I have many things to do in parallel, so I try to do the strict necessary and delegate the rest to new SableVM developers. So, if you only need a few easy additional JNI hooks to add, I can try to do it fast. Etienne -- Etienne M. Gagnon, Ph.D. http://www.info.uqam.ca/~egagnon/ SableVM: http://www.sablevm.org/ SableCC: http://www.sablecc.org/ |
From: David <db...@cs...> - 2003-03-21 16:52:06
|
Etienne, I noticed that I sent about the same reply at the same time... Do you prefer to implement that one yourself. I don't mind doing it if you don't have time. David On Fri, Mar 21, 2003 at 09:52:21AM -0500, Prof. Etienne M. Gagnon wrote: > Mark Howard wrote: > >Thanks for your reply. Unfortunately I'm now getting a different error= . > >sablevm: INTERNAL ERROR (source file "native_interface.c", line 24443)= : > >todo > >Aborted > >I guess this is just unfinished code, so there's little I can do but > >wait. >=20 > Ah! You're using GetByteArrayRegion. This is easy enough to add. Cou= ld=20 > you send the list of the JNI functions your native library is calling. = I=20 > know, SableVM should implement all of them, but I had a thesis to finis= h=20 > first... Right now, I have many things to do in parallel, so I try to d= o=20 > the strict necessary and delegate the rest to new SableVM developers. = So,=20 > if you only need a few easy additional JNI hooks to add, I can try to d= o it=20 > fast. >=20 > Etienne > --=20 > Etienne M. Gagnon, Ph.D. http://www.info.uqam.ca/~egagnon/ > SableVM: http://www.sablevm.org/ > SableCC: http://www.sablecc.org/ >=20 >=20 >=20 > ------------------------------------------------------- > This SF.net email is sponsored by:Crypto Challenge is now open!=20 > Get cracking and register here for some mind boggling fun and=20 > the chance of winning an Apple iPod: > http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en > _______________________________________________ > Sablevm-user mailing list > Sab...@li... > https://lists.sourceforge.net/lists/listinfo/sablevm-user --=20 --- David B=E9langer Graduate Student School of Computer Science McGill University Office: MC226 Web page: http://www.cs.mcgill.ca/~dbelan2/ Public key: http://www.cs.mcgill.ca/~dbelan2/public_key.txt |
From: Prof. E. M. G. <eti...@uq...> - 2003-03-21 17:28:46
|
David B=E9langer wrote: > I noticed that I sent about the same reply at the same time... > > Do you prefer to implement that one yourself. I don't mind doing it i= f > you don't have time. I can implement Get*ArrayRegion(), unless you absolutely want to do it. = I'll=20 let you implement any required additional ones. Etienne --=20 Etienne M. Gagnon, Ph.D. http://www.info.uqam.ca/~egagnon/ SableVM: http://www.sablevm.org/ SableCC: http://www.sablecc.org/ |
From: Prof. E. M. G. <eti...@uq...> - 2003-03-23 04:00:20
|
Hi Mark, I have just checked in CVS the code for [Get/Set]*ArrayRegion. I have put a snapshot of SableVM with the fix in it at: http://www.info.uqam.ca/~egagnon/sablevm-snapshot/ You download the 4 files, give execution permission to the "build" script, the run "./build" as root. This should install the snapshot in /usr/local. So, to run this version, you should type "/usr/local/bin/sablevm". Please let us know if it helps. Etienne On Fri, Mar 21, 2003 at 01:50:04PM +0000, Mark Howard wrote: > Thanks for your reply. Unfortunately I'm now getting a different error. > sablevm: INTERNAL ERROR (source file "native_interface.c", line 24443): > todo > Aborted > I guess this is just unfinished code, so there's little I can do but > wait. --=20 Etienne M. Gagnon, Ph.D. http://www.info.uqam.ca/~egagnon/ SableVM: http://www.sablevm.org/ SableCC: http://www.sablecc.org/ |
From: Mark H. <mh...@ti...> - 2003-03-25 09:25:49
|
On Sun, 2003-03-23 at 03:50, Prof. Etienne M. Gagnon wrote: > I have just checked in CVS the code for [Get/Set]*ArrayRegion. I have > put a snapshot of SableVM with the fix in it at: > > http://www.info.uqam.ca/~egagnon/sablevm-snapshot/ Hi, This has fixed the previous problem, thanks. I'm now getting another one though... sablevm: INTERNAL ERROR (source file "native_interface.c", line 24443): todo As far as I know, the main JNI functions we require are get/release StringUTFChars NewStringUTF NewIntArray get/release IntArrayElements NewByteArray set/release ByteArrayElements GetObjectClass GetFieldID GetIntField NewGlobalRef GetMethodID ExceptionOccurred ExceptionClear FindClass ThrowNew I think you have implemented many of these already though. Also, for the -p java.library.path, I think it might be a good idea to add this to the manpage as an example of how to use the -p option -- .''`. Mark Howard : :' : `. `' http://www.tildemh.com `- mh...@de... | mh...@ti... | mh...@ca... |
From: Prof. E. M. G. <eti...@uq...> - 2003-03-29 02:51:15
|
Mark Howard wrote: > Hi, > This has fixed the previous problem, thanks. > I'm now getting another one though... > > sablevm: INTERNAL ERROR (source file "native_interface.c", line 24443): > todo Are you sure of the line number? The line number above was in your previous message http://sourceforge.net/mailarchive/message.php?msg_id=4188827 . Please make sure you have set you path correctly, or that you type the path explicitly, e.g.: $ /usr/local/bin/sablevm -Y ... > get/release StringUTFChars > NewStringUTF > NewIntArray > get/release IntArrayElements > NewByteArray > set/release ByteArrayElements All of these are already implemented. > GetObjectClass > GetFieldID > GetIntField > NewGlobalRef > GetMethodID > ExceptionOccurred > ExceptionClear > FindClass > ThrowNew Only ExceptionClear is missing. I will implement it in the upcoming minutes and let you know when it is done. > Also, for the -p java.library.path, I think it might be a good idea to > add this to the manpage as an example of how to use the -p option I'll leave the manpage modifs to Grzegorz. ;-) Etienne |
From: Prof. E. M. G. <eti...@uq...> - 2003-03-29 03:38:05
|
Hi Mark, As promised, I added the missing JNI function. Please let us know if it works. Again, I have put a snapshot of SableVM with the fix in it at: http://www.info.uqam.ca/~egagnon/sablevm-snapshot/ You download the 4 files, give execution permission to the "build" script, then run "./build" as root. This should install the snapshot in /usr/local. To run this version, you should type "/usr/local/bin/sablevm [arguments]...". Have fun! Etienne Mark Howard wrote: > As far as I know, the main JNI functions we require are >... > ExceptionClear >... |
From: David <db...@cs...> - 2003-03-21 14:52:30
|
On Fri, Mar 21, 2003 at 01:50:04PM +0000, Mark Howard wrote: > On Fri, 2003-03-21 at 05:31, David B=E9langer wrote: > > sablevm -p java.library.path=3DDIR ... >=20 > Thanks for your reply. Unfortunately I'm now getting a different error. > sablevm: INTERNAL ERROR (source file "native_interface.c", line 24443): > todo > Aborted > I guess this is just unfinished code, so there's little I can do but > wait. In my file, that line is located in GetByteArrayRegion that is still unimplemented. Could you confirm this is the one you need and I will implement it as it should be relatively easy and send a patch. We want to run as many applications as possible. Feel free to send the name of the unimplemented functions you need and we will try to implement them first. David > --=20 > .''`. Mark Howard > : :' : > `. `' http://www.tildemh.com=20 > `- mh...@de... | mh...@ti... | mh...@ca...=20 >=20 >=20 >=20 > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Sablevm-user mailing list > Sab...@li... > https://lists.sourceforge.net/lists/listinfo/sablevm-user --=20 --- David B=E9langer Graduate Student School of Computer Science McGill University Office: MC226 Web page: http://www.cs.mcgill.ca/~dbelan2/ Public key: http://www.cs.mcgill.ca/~dbelan2/public_key.txt |
From: Mark H. <mh...@ti...> - 2003-03-21 21:26:21
|
On Fri, 2003-03-21 at 14:52, David Bélanger wrote: > In my file, that line is located in GetByteArrayRegion that is still > unimplemented. Could you confirm this is the one you need and I will > implement it as it should be relatively easy and send a patch. It probably is.. Although, we have just begun replacing all of these with GetStringUTFChars and ReleaseStringUTFChars > We want to run as many applications as possible. Feel free to send the > name of the unimplemented functions you need and we will try to > implement them first. Great!, thanks I don't have a list of all which we use, but I can keep sending reports when I notice problems. FYI, the application I'm working on is BugWatcher, a program for viewing Debian bug reports. The interesting part is that this uses Java-GNOME, which is an attempt to create GNOME and GTK bindings for java - this is where the JNI is involved. -- .''`. Mark Howard : :' : `. `' http://www.tildemh.com `- mh...@de... | mh...@ti... | mh...@ca... |
From: Prof. E. M. G. <eti...@uq...> - 2003-03-29 19:36:50
|
Hi Mark, I have tried to install the java-gnome related debian packages, on my debian/powerpc based PowerBook [a very nice laptop;)], but I got: ----- BEGIN ----- # apt-get install libgnome0-java Reading Package Lists... Done Building Dependency Tree... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. Since you only requested a single operation it is extremely likely that the package is simply not installable and a bug report against that package should be filed. The following information may help to resolve the situation: Sorry, but the following packages have unmet dependencies: libgnome0-java: Depends: libgtk0-java (= 0.8.0cvs20030320-1) but it is not going to be installed Depends: libgnome0-jni (= 0.8.0cvs20030320-1) but it is not installable E: Sorry, broken packages ----- END ----- I will file a bug about it, but meanwhile, where can I find the sources to install and try to run your BugWatcher application (and all its dependencies)? [Ideally, I'd like to get the shortest list of instructions to get it up and running]. Also, is there any reason why the java-gnome jni code wouldn't compile under PowerPC? Thanks in advance, Etienne Mark Howard wrote: > Hi, > Sorry. I've tried it again and noticed that I probably gave you > completely the wrong information. Here is the full output: > > > *** Couldn't bind native method Java_java_lang_Thread_interrupted *** > *** or Java_java_lang_Thread_interrupted__ *** > java.lang.UnsatisfiedLinkError > at java.lang.Thread.interrupted(Thread.java) > at com.tildemh.debbug.CacheWriter.run(CacheWriter.java:44) > at java.lang.Thread.callRun(Thread.java:372) > at java.lang.VirtualMachine.runThread(VirtualMachine.java:117) > /usr/local/bin/sablevm -Y -p > java.library.path=/home/mark/dev/java-gnome/lib > --classpath=/usr/share/java/oro.jar:/home/mark/dev/java-gnome/lib/gtk.jar:/home/mark/dev/java-gnome/lib/gnome.jar:.:/home/mark/dev/jdebbug/debbuggtk/src/:/home/mark/dev/jdebbug/libdebbug-java/src/ com.tildemh.debbuggtk.BugWatcher |
From: Mark H. <mh...@ti...> - 2003-03-30 08:38:50
|
Hi, On Sat, 2003-03-29 at 19:36, Prof. Etienne M. Gagnon wrote: > I have tried to install the java-gnome related debian packages, on my > debian/powerpc based PowerBook [a very nice laptop;)], but I got: replied to bug report. > I will file a bug about it, but meanwhile, where can I find the sources to > install and try to run your BugWatcher application (and all its dependencies)? > [Ideally, I'd like to get the shortest list of instructions to get it up and > running]. At the moment they're at http://tildemh.com/tmp/debbuggtk. There are two tarballs, both are needed. The easiest way to compile them would be to extract them, go into the directory and do fakeroot debian/rules binary. Packages are in the NEW queue on the Debian repository so will also be in the main archive when the ftpmasters approve them. > Also, is there any reason why the java-gnome jni code wouldn't compile under > PowerPC? I don't know of any. Please send me the output you get -- .''`. Mark Howard : :' : `. `' http://www.tildemh.com `- mh...@de... | mh...@ti... | mh...@ca... |
From: Mark H. <mh...@ti...> - 2003-03-30 14:21:54
|
On Sun, 2003-03-30 at 09:38, Mark Howard wrote: > > I will file a bug about it, but meanwhile, where can I find the sources to > > install and try to run your BugWatcher application (and all its dependencies)? > > [Ideally, I'd like to get the shortest list of instructions to get it up and > > running]. > At the moment they're at http://tildemh.com/tmp/debbuggtk. There are two > tarballs, both are needed. The easiest way to compile them would be to > extract them, go into the directory and do fakeroot debian/rules binary. Sorry, those packages probably won't be much use to you because they depend on the latest cvs java-gnome. I've just uploaded 0.5 packages which work with the Java-Gnome in Debian. -- .''`. Mark Howard : :' : `. `' http://www.tildemh.com `- mh...@de... | mh...@ti... | mh...@ca... |