Skip site navigation (1)Skip section navigation (2)
Date:      14 Feb 2002 18:34:58 -0800
From:      Joe Kelsey <joe@zircon.seattle.wa.us>
To:        gsemones@treenleaf.com, freebsd-java@FreeBSD.ORG
Subject:   Re: Need info for compiling JDK1.3.1 on FreeBSD with Native Threads
Message-ID:  <1013740498.54099.20.camel@zircon.zircon.seattle.wa.us>
In-Reply-To: <1013740139.54099.15.camel@zircon.zircon.seattle.wa.us>
References:  <200202141005.AA177340734@mail.mstar2.net>  <1013740139.54099.15.camel@zircon.zircon.seattle.wa.us>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 2002-02-14 at 18:28, Joe Kelsey wrote:
> On Thu, 2002-02-14 at 09:05, Guerry Semones wrote:
> > Sorry if this is in a FAQ somewhere.  I know the Native Threads 
> > implementation is under way.
> > 
> > Here is what I am trying to accomplish as explained briefly in a 
> > previous post.  We are porting a C++ application that initializes 
> > the JVM and calls Java classes from the C++ side.  I'd like to be 
> > able to get a Native Threads JDK (1.2 or 1.3) compiled for FreeBSD 
> > that we can then link into our C++ application.
> > 
> > I have been trying various suggestions for the Green Threads 
> > stuff, but get a core dump on the JNI_CreateJavaVM call.  Of 
> > course, there are warnings of just this sort of issue when trying 
> > to do this with Green Threads, so....  Native?  :-)
> 
> There is no trouble doing this as long as you set up the environment
> appropriately.  That means that you have to set up PATH, LD_LIBRARY_PATH
> and CLASSPATH to point to the right locations.  You also have to set
> THREADS_TYPE correctly.  In the port, look at
> j2sdk1.3.1/ext/plugin/oji-plugin/src/motif/jvm_exec/java_vm.c for how
> the Mozilla plugin performs this bit of magic.

I forgot to mention the most important thing.  Depending on which
threading system you use, you must make sure that your use of libc
versus libc_r matches what the threading system expects.  If you link
your program with -pthreads, then you can only use native threads.  If
you link your program with straight libc, then you can still get into
trouble, depending on the order of library loading.

You can detect problems by tracing calls to dlopen in a debugger and
seeing which ones cause errors.

It is extremely tricky due to the bad design of the FreeBSD runtime
loader and the poor pthreads/libc_r mixture.

Good luck, you will need it!

/Joe



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-java" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1013740498.54099.20.camel>