Initialization Error

Magnus Ihse Bursie magnus.ihse.bursie at oracle.com
Fri Mar 1 14:49:17 UTC 2019


On 2019-03-01 14:48, Gary Adams wrote:
> It's been a long time since I've done any builds in this area, but
> you could try linking with libffi.a to bypass the runtime
> library linkage issues.
>
> Another possibility, the zero vm is reason libffi is being used.
> I don't think it is required with the other vm variants.
That's correct; libffi is only required by zero.

/Magnus

>
> On 2/28/19, 8:38 PM, Sparse Way wrote:
>> The only workaround would require re-executing the process within JNI 
>> side using the execve function in order to apply ld_library_path, 
>> this is covered here:
>>
>> http://hg.openjdk.java.net/jdk8u/jdk8u/jdk/file/4fa603c72f2f/src/solaris/bin/java_md_solinux.c 
>>
>>
>> But I guess this isn't possible on android.
>>
>> Working through JNI seems to be nonfunctional at the moment unless 
>> the export path issue resolves.
>>
>> Best regards
>> ------------------------------------------------------------------------
>> *From:* mobile-dev <mobile-dev-bounces at openjdk.java.net> on behalf of 
>> Sparse Way <support at sparseway.com>
>> *Sent:* Thursday, February 28, 2019 8:20 PM
>> *To:* gary.adams at oracle.com; mobile-dev at openjdk.java.net
>> *Subject:* Re: Initialization Error
>> libjvm cannot find libffi.so.6 despite that it is in jre/lib.
>>
>> javalauncher_api::loadJavaVM: dlopen failed for 
>> /storage/emulated/0/jre/lib/server/libjvm.so (dlerr r dlopen failed: 
>> library "libffi.so.6" not found).
>>
>> Any ideas?
>> ________________________________
>> From: mobile-dev <mobile-dev-bounces at openjdk.java.net> on behalf of 
>> Sparse Way <support at sparseway.com>
>> Sent: Thursday, February 28, 2019 6:00 PM
>> To: gary.adams at oracle.com; mobile-dev at openjdk.java.net
>> Subject: Re: Initialization Error
>>
>> --enable-libffi-bundling=yes
>> ________________________________
>> From: Sparse Way
>> Sent: Thursday, February 28, 2019 5:52 PM
>> To: gary.adams at oracle.com; mobile-dev at openjdk.java.net
>> Subject: Re: Initialization Error
>>
>> Turned out libffi.so.6 is missing and after checking the 
>> configuration log file, the library is not bundled:
>>
>> checking if libffi works... yes
>> checking if libffi should be bundled... no
>>
>> Configuration:
>>
>> bash configure --enable-option-checking=fatal 
>> --build=x86_64-unknown-linux-gnu --host=arm-linux-androideabi 
>> --target=arm-linux-androideabi --disable-warnings-as-errors 
>> --enable-headless-only --with-jdk-variant=normal 
>> --with-jvm-variants=zero --with-libffi=$LIBFFI_DIR 
>> --with-cups-include=$CUPS_DIR --with-devkit=$ANDROID_DEVKIT 
>> --with-debug-level=fastdebug --with-freetype=$FREETYPE_DIR
>>
>> Tried to replace --with-libffi with 
>> --with-libffi-include=$LIBFFI_DIR/include 
>> --with-libffi-lib=$LIBFFI_DIR/lib but still it's not bundled.
>> ________________________________
>> From: gary.adams at oracle.com <gary.adams at oracle.com>
>> Sent: Thursday, February 28, 2019 12:53 PM
>> To: Sparse Way; mobile-dev at openjdk.java.net
>> Subject: Re: Initialization Error
>>
>> Check the path to the libjvm in the dlopen call:
>>
>> jdk/src/java.base/share/native/javalauncher_api/javalauncher_api.c
>>
>> On 2/27/19 8:17 PM, Sparse Way wrote:
>> > Hi,
>> >
>> > Library ocldvk loaded without problems, however loadJavaVM in 
>> javalauncher_api.c is returning JL_CANTLOADLIBJVM after calling 
>> JavaLauncher.createJavaVM(jre, new String[]{}, null).
>> >
>> > D/JVM: JavaLauncher_jni::initialize: Cannot initialize 
>> javalauncher_api, errocode -1019.
>> > java.lang.IllegalArgumentException: Cannot initialize Java runtime
>> > at 
>> com.oracle.dalvik.javalauncher.JavaLauncher.initialize(JavaLauncher.java:280)
>> > at 
>> com.oracle.dalvik.javalauncher.JavaLauncher.createJavaVM(JavaLauncher.java:349)
>>
>>
>



More information about the mobile-dev mailing list