Re: Plugin control panel crashes Netscape
Juergen Kreileder wrote: > >> Do you use a glibc-2.x version of netscape? > > Rachel> Is there an easy way I can verify this? (I know there's a > Rachel> command to run on an executable to see what library > Rachel> dependencies it has, but I can't remember what it is.) > > ldd libc.so.6 ... among other things > For 4.72 there are three versions): > > Supported/Linux 2.0: > This is a libc5 version and it doesn't work with the Java Plug-In. > > Supported/Linux 2.2 (glibc): > This is a glibc-2.0 version and the Plug-In should work with it. > > Unsupported/Linux: > Glibc-2.1 version. Java Plug-In works. > This version is not supported by Netscape. IMO that doesn't mean > much to the normal user. It sometimes crashes or hangs but the > supported versions do that too. Well, it's one of the latter two I'm sure. The file I installed from is called communicator-v472-export.x86-unknown-linux2.2.tar.gz which seemed the most appropriate one to install for a glibc2.1.2 installation at the time, so I guess it's probably the Unsupported/Linux version. Could try reinstalling I suppose... BTW the control panel does work when run standalone (ie: running the ControlPanel script directly). -- Rachel -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: Plugin control panel crashes Netscape
Adam Ambrose wrote: > > Rachel Greenham wrote: > > > Yes. That's the one I downloaded from netscape.com anyway, to my > > recollection, that didn't work with the libc5 Acrobat plugin either, but > > does with the newer presumably glibc one that's come out more recently. > > > > Is there an easy way I can verify this? (I know there's a command to run on > > an executable to see what library dependencies it has, but I can't remember > > what it is.) > > 'ldd' is the command you want. > > $ ldd `which netscape` > /lib/libNoVersion.so.1 => /lib/libNoVersion.so.1 (0x40013000) > libBrokenLocale.so.1 => /lib/libBrokenLocale.so.1 (0x4001d000) > libXt.so.6 => /usr/X11R6/lib/libXt.so.6 (0x4001f000) > libSM.so.6 => /usr/X11R6/lib/libSM.so.6 (0x4006b000) > libICE.so.6 => /usr/X11R6/lib/libICE.so.6 (0x40074000) > libXmu.so.6 => /usr/X11R6/lib/libXmu.so.6 (0x4008b000) > libXpm.so.4 => /usr/X11R6/lib/libXpm.so.4 (0x4009e000) > libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x400ac000) > libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x400b8000) > libdl.so.2 => /lib/libdl.so.2 (0x4015c000) > libstdc++.so.2.8 => /usr/lib/libstdc++.so.2.8 (0x4015f000) > libm.so.6 => /lib/libm.so.6 (0x401a) > libc.so.6 => /lib/libc.so.6 (0x401bc000) > /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x4000) Apart from different hex numbers, this is the output I get. > The 2nd to the last line there shows that this netscape is linked to > /lib/libc.so.6, which is glibc. To find the version of glibc, > > $ ls -l /lib/libc.so.6 > lrwxrwxrwx 1 root root 13 Dec 21 04:58 /lib/libc.so.6 -> > libc-2.1.2.so nope, /lib/libc.so.6 is a real file on this SuSE, but I'm pretty sure it's a 2.1.2 installation. The latest Blackdown JDK1.2.2RC4 works on it for one thing, and there is a /lib/ld-2.1.2.so -- Rachel -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: C-like functionality in numeric output
Thank you Cyntia, I have read this docs and found that it is easier to convert leading zeroes to spaces by myself. Regards, Jacob Nikom Cynthia Jeness wrote: > > Jacob, > > I also think that this should be part of standard Java; however, here is > a paragraph from the Javadoc supplied with Java 2 for the NumberFormat > class: > > ---Extract from JavaDoc-- > You can also use forms of the parse and format methods with ParsePosition > and FieldPosition to allow you to: > > progressively parse through pieces of a string > align the decimal point and other areas > > For example, you can align numbers in two ways: > > 1.If you are using a monospaced font with spacing for alignment, you > can pass the FieldPosition in your format call, with > field = INTEGER_FIELD. On output, getEndIndex will be set to the > offset between the last character of the integer and > the decimal. Add (desiredSpaceCount - getEndIndex) spaces at the > front of the string. > 2.If you are using proportional fonts, instead of padding with > spaces, measure the width of the string in pixels from the start to > getEndIndex. Then move the pen by (desiredPixelWidth - > widthToAlignmentPoint) before drawing the text. It also works > where there is no decimal, but possibly additional characters at > the end, e.g., with parentheses in negative numbers: "(12)" > for -12. > - > > Cynthia Jeness > > Jacob Nikom wrote: > > > Thank you very much Juergen, > > > > It sounds like there is no such functionality in "standard" Java > > at all - this is strange. To be able to right-justified numbers > > is the basic requirement for any numerical output. > > > > It is not a problem to write a program which does it - actually > > it is quite easy to convert leading zeroes into spaces. I wanted > > to have "pure" Java solution in the sense that people should not > > write what is already written (or should be written). > > > > If I find "standard Java" solution I will post it. > > > > Regards, > > > > Jacob Nikom > > > > Juergen Kreileder wrote: > > > > > > > Jacob Nikom writes: > > > > > > Jacob> I used DecimalFormatter class: > > > > > > Jacob> DecimalFormat myFormatter = new DecimalFormat(""); > > > Jacob> String iString = myFormatter.format(myNumber); > > > > > > Jacob> However, what I got was: > > > > > > Jacob> 0001 > > > Jacob> 0012 > > > Jacob> 0344 > > > Jacob> 1557 > > > > > > Jacob> (The pattern "" did not work at all) > > > > > > Jacob> Do you know, how I can get rid of leading zeroes and get > > > Jacob> my formatting correctly? > > > > > > I never tried it but maybe this does what you want: > > > > > > http://www2.jps.net/~adahlman/programs/PaddedDecimalFormat.java > > > http://pws.prserv.net/ad/programs/PaddedDecimalFormat.html (Javadoc) > > > > > > Juergen > > > > > > -- > > > Juergen Kreileder, Blackdown Java-Linux Team > > > http://www.blackdown.org/java-linux.html > > > > -- > > To UNSUBSCRIBE, email to [EMAIL PROTECTED] > > with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Accessing a JNIEnv pointer from within a C++ jni function
The Java jni specifications require a JNIEnv* for almost all functions they provide. Furthermore it seems that if multiple Java threads can access the same function, each function call must use the JNIEnv* from the current thread. Given that function I am writing is maybe 20 deep in a call hierarchy of C++ functions I have written, is there any way of accessing the correct JNIEnv* short of passing it all the way down as C++ function arguments? Putting it in a global or within a global class does not work in my case because multiple Java threads can be using the same C++ function. I need a solution that works under Linux, though something that is portable to Microsoft* would be ideal. Norman Shapiro 5011 Mattos Ct Fremont CA 94536-7170 (510) 795-1800 [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: Accessing a JNIEnv pointer from within a C++ jni function
On Tuesday Mar 28, 2000, Norman Shapiro wrote: > The Java jni specifications require a JNIEnv* for almost all > functions they provide. Furthermore it seems that if multiple > Java threads can access the same function, each function call must > use the JNIEnv* from the current thread. > > Given that function I am writing is maybe 20 deep in a call > hierarchy of C++ functions I have written, is there any way of > accessing the correct JNIEnv* short of passing it all the way down > as C++ function arguments? > > Putting it in a global or within a global class does not work in > my case because multiple Java threads can be using the same C++ > function. > > I need a solution that works under Linux, though something that is > portable to Microsoft* would be ideal. You could save the pointer in thread local storage, but I guarantee that it won't be portable. Take a look at pthread_key_create, pthread_setspecific, et al. -John John Rousseau [EMAIL PROTECTED] SilverStream Software 1 Burlington WoodsPhone: +1 781 238 5564 Burlington, MA 01803Fax: +1 781 238 5499 -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: Accessing a JNIEnv pointer from within a C++ jni function
On Tuesday Mar 28, 2000, Norman Shapiro wrote: > [EMAIL PROTECTED] (John Rousseau) writes: > >You could save the pointer in thread local storage, but I guarantee > >that it won't be portable. > > > >Take a look at pthread_key_create, pthread_setspecific, et al. > > > > Thanks much, that's exactly what I need. > > Would this work under green threads or just under native threads? Those are native threads calls. LinuxThreads is a pthreads (POSIX 1003.1c) implementation. I don't know much about green threads at all except it is not a pthreads implementation. So, to answer your question, under native threads only. Green threads most likely provides similar functionality, but with a different API. -John John Rousseau [EMAIL PROTECTED] SilverStream Software 1 Burlington WoodsPhone: +1 781 238 5564 Burlington, MA 01803Fax: +1 781 238 5499 -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
help with jdk1.2.2
Hi- I just downloaded and installed jdk1.2.2 on RH6.1. When trying to run some sample code, I get the following message: Exception in thread "main" java.lang.NoClassDefFoundError: p1/Protection Here is what I have: jdk1.2.2 is installed in /usr/local. My path variable has /usr/local/jdk1.2.2/bin included. I have the CLASSPATH variable set as: CLASSPATH=/home/dad/MyJava The code I am running is in directory "p1" under "MyJava". One of the classes is Protection.java which declares a package p1. I compile using the command: java p1.Protection Any insights/advice is greatly appreciated. TIA, Steve [P.S. I apologize if you get this message twice] -- Steve Ettorre e-mail: [EMAIL PROTECTED] --- "...thinking is not consciousness - it requires hard work..." - Rush Limbaugh --- -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: Accessing a JNIEnv pointer from within a C++ jni function
> John Rousseau writes: John> On Tuesday Mar 28, 2000, Norman Shapiro wrote: >> The Java jni specifications require a JNIEnv* for almost all >> functions they provide. Furthermore it seems that if multiple >> Java threads can access the same function, each function call must >> use the JNIEnv* from the current thread. >> >> Given that function I am writing is maybe 20 deep in a call >> hierarchy of C++ functions I have written, is there any way of >> accessing the correct JNIEnv* short of passing it all the way down >> as C++ function arguments? >> >> Putting it in a global or within a global class does not work in >> my case because multiple Java threads can be using the same C++ >> function. >> >> I need a solution that works under Linux, though something that is >> portable to Microsoft* would be ideal. John> You could save the pointer in thread local storage, but I guarantee John> that it won't be portable. John> Take a look at pthread_key_create, pthread_setspecific, et al. A more portable approach is to use JNI_GetCreatedJavaVMs() and AttachCurrentThread(). If the calling thread is already a java thread AttachCurrentThread() will return its JNIEnv. Juergen -- Juergen Kreileder, Blackdown Java-Linux Team http://www.blackdown.org/java-linux.html -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: Accessing a JNIEnv pointer from within a C++ jni function
IMHO, you have two options: either pass JNIEnv* to each level, or pass your C++ objects back to the top level, and use JNIEnv* on them there. The second option would avoid you having to make all your classes "JNI-aware". To avoid that with the first option, hide JNIEnv* in a struct or a class or as a void*. Only the classes which use JNIEnv* would then have to be "JNI-aware". At 05:28 PM 3/28/00 +, Norman Shapiro wrote: >The Java jni specifications require a JNIEnv* for almost all functions they >provide. Furthermore it seems that if multiple Java threads can access the same >function, each function call must use the JNIEnv* from the current thread. > >Given that function I am writing is maybe 20 deep in a call hierarchy of C++ >functions I have written, is there any way of accessing the correct JNIEnv* >short of passing it all the way down as C++ function arguments? > >Putting it in a global or within a global class does not work in my case because >multiple Java threads can be using the same C++ function. > >I need a solution that works under Linux, though something that is portable to >Microsoft* would be ideal. oo0oo0oo0oo0oo0oo0oo0oo0oo0oo0oo0oo0oo0oo0oo0oo0oo0oo0oo0oo0oo0oo0oo0oo0oo Send Sun a Message! Vote for JConfig in the JDJ Readers' Choice Awards. http://www.sys-con.com/java/readerschoice2000/ See the 'Best Class Library' category. oo0oo0oo0oo0oo0oo0oo0oo0oo0oo0oo0oo0oo0oo0oo0oo0oo0oo0oo0oo0oo0oo0oo0oo0oo -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]