Skip to the content.

Troubleshooting Java Plugins guide

This interface and all derived plugins are written in Java, so you need to have installed a Java Runtime Environment (JRE). The Java plugin interface and derived plugins were tested on Oracle (Sun) JRE 1.8 (jre-8u311-windows-x64.exe).

Let me know whether this guide solves your problem or not - contact details below

Table of Contents

Be sure you use the same (32/64) platform for JVM and TC

This is, if you still use TC32 bits, the JVM should be a 32 bits version, and if you use TCx64, JVM should be a x64 bits version. For finding out the JVM/JRE the Java plugin using, refer to the JRE section You can change the JVM used by the Java plugin adding these 2 properties to the [JVM] section in the tc_javaplugin.ini file, changing the paths to your JRE install dir:

JVM_DLL=c:\Program Files\Java\jre1.8.0_311\bin\server\jvm.dll
JVM_HOME=c:\Program Files\Java\jre1.8.0_311

In case you have more than one Java plugin installed

In order to save CPU and memory resources, every Java plugin is executed in the same JVM. Besides resources being saved, plugin execution is much faster.

The drawback of this approach is that configuration, such as libraries and properties, is shared between all the Java plugins. The configuration of the first loaded plugin, specified in tc_javaplugin.ini, is used.

In particular, be sure that the JAVA.CLASS.PATH variable in the JVM section of every [plugin]/tc_javaplugin.ini points to a javalib directory with the last version of tc-classsloader-x.y.z.jar

In case you have both TCx64 and TCx32 installed

If you have both TCx64 and TCx32 installed, plugins are installed under TCx64, but javalib is searched under %COMMANDER% variable, which TCx32 stablishes to its own dir.

This can be solved copying the plugin dir, including javalib, from TCx64 to TCx32.

Then check above the “Be sure you use the same (32/64) platform for JVM and TC” section and modify the tc_javaplugin.ini file accordingly.

Error Java Runtime Environment is not installed on this Computer

Issue for this error has been closed

Short version of solution:

Add these 2 properties to the [JVM] section in the [TOTALCMD-INSTALL-DIR]/wcx/JavaDecompiler/tc_javaplugin.ini file, changing the paths to your JRE install dir:

JVM_DLL=c:\Program Files\Java\jre1.8.0_311\bin\server\jvm.dll
JVM_HOME=c:\Program Files\Java\jre1.8.0_311

Long version of solution:

The Java plugin interface searchs for the JRE in two ways:

  1. In the Windows Registry, it searchs for the key HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment

    there it queries for “JavaHome” and “RuntimeLib”, e.g. my computer registry values:

     JavaHome		C:\Program Files\Java\jre1.8.0_311
     RuntimeLib		C:\Program Files\Java\jre1.8.0_311\bin\server\jvm.dll
    
  2. If those values do not exist, it searches for the config file: [PLUGIN_DIR]/tc_javaplugin.ini

    in that file, in the [JVM] section, it searches for two properties:

     JVM_DLL=c:\Program Files\Java\jre1.8.0_311\bin\server\jvm.dll
     JVM_HOME=c:\Program Files\Java\jre1.8.0_311
    

Oracle’s (Sun) JDK and JRE installlables are executables that set those registry values. If your JRE installable was just a zip file and it did not set those registry values, this is an example of how tc_javaplugin.ini can be configured:

[GENERAL]
LANGUAGE=EN

[JVM]
JAVA.OPTIONS=
JAVA.TC.JAVALIB=-Dtc.java.lib=%COMMANDER_PATH%/plugins/wcx/JavaDecompiler/javalib
JAVA.CLASS.PATH=-Djava.class.path=%COMMANDER_PATH%/plugins/wcx/JavaDecompiler/javalib/tc-classloader-2.2.jar
JVM_DLL=c:\Program Files\Java\jre1.8.0_311\bin\server\jvm.dll
JVM_HOME=c:\Program Files\Java\jre1.8.0_311

[WCX]
CLASS=moi.tcplugins.decompiler.Decompiler

If you get a Java Runtime Environment is not installed on this Computer error, and you have it installed, check the response to this issue. In short: add these 2 properties to the [JVM] section in the tc_javaplugin.ini file, changing the paths to your JRE install dir:

JVM_DLL=c:\Program Files\Java\jre1.8.0_311\bin\server\jvm.dll
JVM_HOME=c:\Program Files\Java\jre1.8.0_311

Error LoadLibrary Failed

There is an open issue for this error

First be sure you use the same (32/64) platform for JVM and TC. This is, if you still use TC32 bits, the JVM should be a 32 bits version, and if you use TCx64, JVM should be a x64 bits version. For checking which JVM/JRE is the Java plugin using, refer to the JRE section

In case that fails, continue reading.

Java plugin interface and derived plugins like JavaDecompiler and DiskDirCrc have been tested on Oracle (Sun) JRE 1.8 (jre-8u311-windows-x64.exe). Other Oracle versions should also work fine.

However OpenJDK versions have been reported to fail with 2 types of error when the plugin tries to start the JVM:

Some development has to be done to get OpenJDKs to work (help wanted!).

By now, recommendation is to install an Oracle (Sun) JDK/JRE version.

Let me know if you have this issue, and what are your JDK/JRE and TCMD versions

JREs reported to work fine with the Java plugin interface:

JREs reported to give LoadLibrary Failed error:

Error Starting Java Virtual Machine failed

There is an open issue for this error

Java plugin interface and derived plugins like JavaDecompiler and DiskDirCrc have been tested on Oracle (Sun) JRE 1.8 (jre-8u311-windows-x64.exe). Other Oracle versions should also work fine.

JREs reported to give Starting the Java Virtual Machine failed. status =-6 error:

OpenJDK versions have been reported to fail, By now, recommendation is to install an Oracle (Sun) JDK/JRE version.

Error Class not found class=’tcclassloader/PluginClassLoader’

Be sure that the JAVA.CLASS.PATH variable in the JVM section of tc_javaplugin.ini points to a javalib directory with the last version of tc-classsloader-x.y.z.jar

If you have more java plugins installed, refer to that section.

Error Initialization failed in class…’

Be sure that the JAVA.CLASS.PATH variable in the JVM section of tc_javaplugin.ini points to a javalib directory with the last version of tc-classsloader-x.y.z.jar

If you have more java plugins installed, refer to that section.

Error Exception in class ‘tcclassloader/PluginClassLoader’

Most probably another java plugin with and older version of PluginClassLoader has been loaded first.

Refer to In-case-you-have-more-than-one-Java-plugin-installed section.

Error Access violation at address…

Most probably the Java plugin is using JVM 32 bits under a TCx64 bit or viceversa.

Check above the “Be sure you use the same (32/64) platform for JVM and TC” section and modify the tc_javaplugin.ini file accordingly.

Error Crash in plugin … Access violation at address…

Most probably the Java plugin is using JVM 32 bits under a TCx64 bit or viceversa.

Check above the “Be sure you use the same (32/64) platform for JVM and TC” section and modify the tc_javaplugin.ini file accordingly.

Issues and things to-do

This is a work in progress. Help wanted! - in particular with Visual C++ issues.

Contact

Let me know if you have any comment, suggestion or problem regarding this java plugin, choose the most appropiate way to contact me:

Please detail the specific version of: Java plugin interface, Total Commander and JRE that you are using.