Welcome Serena Central users! CLICK HERE
The migration of the Serena Central community is currently underway. Be sure to read THIS MESSAGE to get your new login set up to access your account.
mfisher Absent Member.
Absent Member.
3082 views

Java dynamic init failed.

Jump to solution

I'm attempting to get the CobolCallingJava example for ACUCOBOL-GT version 8.1.3.1 working. When running the example, I get the following error for each occurrence of CALL C$"JAVA":

Java dynamic init failed.

It is the same error message as described in the following Wiki article, but in our case we're running this test in Windows 7.

https://community.microfocus.com/microfocus/cobol/extend_and_acucobol/w/knowledge_base/6320.c-java-gives-error-java-dynamic-init-failed.aspx

The JDK installed on my PC is jdk1.7.0_17.

The Java-related settings in our COBOL config file are as follows:

PRELOAD_JAVA_LIBRARY=1
JAVA_LIBRARY_NAME="C:\Program Files\Java\jdk1.7.0_17\jre\bin\server\jvm.dll"
JAVA_OPTIONS=-Djava.class.path=R:\Topps\BIN\CVM.jar;.;

My CLASSPATH environment variable = R:\Topps\BIN\CVM.jar;.;

My PATH environment variable includes the Java bin directory, as well as the directory containing jvm.dll, i.e.,

....;C:\Program Files\Java\jdk1.7.0_17\jre\bin;C:\Program Files\Java\jdk1.7.0_17\jre\bin\server;....

My LD_LIBRARY_PATH environment variable = R:\Topps\BIN

The file R:\Topps\BIN\CVM.jar does exist, as does "C:\Program Files\Java\jdk1.7.0_17\jre\bin\server\jvm.dll".

There are no errors when compiling either the Java or the COBOL programs in the example. However, I do get "Java dynamic init failed" at runtime.

What am I missing? Thanks!

0 Likes
1 Solution

Accepted Solutions
Chuck Edgin Absent Member.
Absent Member.

RE: Java dynamic init failed.

Jump to solution

A few things to look for:

  • Make sure your Acu runtime and the JVM are either both 32-bit or both 64-bit, not one of each.  You can't mix them.
  • In your JAVA_LIBRARY_NAME variable (in the config file), remove the double-quotes.
  • You have CVM.jar in your CLASSPATH, but not sure why you need it.  It's normally only used for Java-calling-COBOL, not the other way around.  But it doesn't hurt to have it there.
  • I don't think what's in your PATH has any bearing on this.
  • LD_LIBRARY_PATH is only meaningful on Unix and Linux systems.  It won't have any effect on Windows.

I've just done a simple test on my Windows 7 64-bit system and got it working - with the quotes removed from JAVA_LIBRARY_NAME.  I'm using JRE 1.7.0_25, and Acu 9.1.2 (both 32-bit).  Since I only have a JRE (not a JDK), my Java library is in the client directory (C:\Program Files (x86)\Java\jre7\bin\client\jvm.dll on my system).  You might need to try with the jvm.dll under client instead of server.

View solution in original post

Tags (1)
0 Likes
3 Replies
Chuck Edgin Absent Member.
Absent Member.

RE: Java dynamic init failed.

Jump to solution

A few things to look for:

  • Make sure your Acu runtime and the JVM are either both 32-bit or both 64-bit, not one of each.  You can't mix them.
  • In your JAVA_LIBRARY_NAME variable (in the config file), remove the double-quotes.
  • You have CVM.jar in your CLASSPATH, but not sure why you need it.  It's normally only used for Java-calling-COBOL, not the other way around.  But it doesn't hurt to have it there.
  • I don't think what's in your PATH has any bearing on this.
  • LD_LIBRARY_PATH is only meaningful on Unix and Linux systems.  It won't have any effect on Windows.

I've just done a simple test on my Windows 7 64-bit system and got it working - with the quotes removed from JAVA_LIBRARY_NAME.  I'm using JRE 1.7.0_25, and Acu 9.1.2 (both 32-bit).  Since I only have a JRE (not a JDK), my Java library is in the client directory (C:\Program Files (x86)\Java\jre7\bin\client\jvm.dll on my system).  You might need to try with the jvm.dll under client instead of server.

View solution in original post

Tags (1)
0 Likes
mfisher Absent Member.
Absent Member.

RE: Java dynamic init failed.

Jump to solution

I'll try your recommendations out, and will report back with the outcome.

My hunch is that you've identified the problem. Our Acu installation is 32-bit, and the path to my jvm.dll indicates 64-bit.

Thanks!

0 Likes
mfisher Absent Member.
Absent Member.

RE: Java dynamic init failed.

Jump to solution

That was it! The only change required was to use this line in the runtime configuration file:

JAVA_LIBRARY_NAME=C:\Program Files (x86)\Java\jre6\bin\client\jvm.dll

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.