This wiki has been moved to https://dev.languagetool.org - this page is archived and is not updated anymore
The "Could Not Create Java Implementation Loader" error message appears for some people when installing a Java-based LibreOffice/OpenOffice extension. It is difficult to reproduce and sometimes disappears by just disabling/enabling Java. Some people manage to fix the issue by re-installing LibreOffice/OpenOffice. In some cases, the problem can be solved by setting a different version of Java and then selecting it in the settings of LibreOffice/OpenOffice.
Some links:
- http://www.zotero.org/support/word_processor_plugin_troubleshooting#could_not_create_java_implementation_loader (the most comprehensive list of workarounds from a user's point-of-view so far)
- http://user.services.openoffice.org/en/forum/viewtopic.php?f=42&t=38873
- http://forums.zotero.org/discussion/16966/error-could-not-create-java-implementation-loader/
- https://bugs.freedesktop.org/show_bug.cgi?id=50371
- https://issues.apache.org/ooo/show_bug.cgi?id=118346
- https://issues.apache.org/ooo/show_bug.cgi?id=120254
- http://languagetool-user-forum.2306527.n4.nabble.com/Language-Tool-lauft-nicht-unter-Win-mit-64bit-td4640533.html
- http://markmail.org/message/ffk7aibz3mz4cti7?q=languagetool+-list:net.sourceforge.lists.languagetool-devel+order:date-backward
Affected extensions
LanguageTool, Oracle report Builder, ODFToEPub, Zotero, Anaphraseus - basically any Java-based extension
Analysis in source code (low level)
This is what Stephan Bergmann explained to me:
What typically fails is
err= pCreateJavaVM(&pJavaVM, ppEnv, &vm_args);
in ./libo/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx. This returns an error code that doesn't help (-1). Debugging might be possible using system-dependent tools like depends.exe under Windows, strace or LD_DEBUG under Linux.
How to continue now
- Find someone who can reproduce the problem and ask them to reproduce with "soffice.exe 2> log.txt" under Cygwin. Maybe the log file contains useful information. (Source)
- Find if there are debug builds available - point people to them if they cannot solve the problem otherwise - it's still unclear if the debug information would help
Analysis in source code (high level)
(This is what I found out, it might be useful for someone, but the "Analysis in source code (low level)" is probably more useful)
I'm not a LibreOffice/OpenOffice nor a C++ developer, but I tried to find the location of the code that causes the problem anyway. The message is displayed in ./core/stoc/source/javaloader/javaloader.cxx when getJavaLoader() returns null. The relevant location might around line 180:
OSL_ENSURE(sizeof (sal_Int64)
>= sizeof (jvmaccess::UnoVirtualMachine *),
"Pointer cannot be represented as sal_Int64");
sal_Int64 nPointer = reinterpret_cast< sal_Int64 >(
static_cast< jvmaccess::UnoVirtualMachine * >(0));
javaVM_xJavaVM->getJavaVM(processID) >>= nPointer;
rtl::Reference< jvmaccess::UnoVirtualMachine > xVirtualMachine(
reinterpret_cast< jvmaccess::UnoVirtualMachine * >(nPointer));
if (!xVirtualMachine.is())
//throw RuntimeException(OUString(RTL_CONSTASCII_USTRINGPARAM(
// "javaloader error - JavaVirtualMachine service could not provide a VM")),
// css::uno::Reference<XInterface>());
// We must not throw a RuntimeException, because this might end the applications.
// It is ok if java components
// are not working because the office can be installed without Java support.
return m_javaLoader; // null-ref
This looks relevant:
javaVM_xJavaVM->getJavaVM(processID) >>= nPointer;
It's defined in ./core/stoc/source/javavm/javavm.cxx. This returns a null (or rather css::uno::Any()) without showing a warning in the following cases:
line ~729:
if (aId != aProcessId)
return css::uno::Any();
line ~738:
if (m_bDontCreateJvm)
//throw css::uno::RuntimeException();
return css::uno::Any();