15

In some computers, but not all, in which my application is installed, after what looks like a successful install, when you try to run it, it shows this error:

enter image description here

The file is present in that directory, so, I'm not sure why it says it failed to find the library.

That error is followed by

enter image description here

and lastly:

enter image description here

and then nothing happens. The application doesn't start. Any ideas what's going on?

Some people pointed to this bug report which seems to be talking about this issue: https://bugs.openjdk.java.net/browse/JDK-8191176 but I have built my application with 8u162 as well as 8u172 (early access, specifically, jdk-8u172-ea-bin-b03-windows-x64-18_jan_2018), and the result is the same. It happens on Windows 10 Pro 1703 as well as 1709.

I'm not sure what else might be relevant.

Pablo Fernandez
  • 279,434
  • 135
  • 377
  • 622
  • 1
    Looks relevant: https://bugs.openjdk.java.net/browse/JDK-8134667 and https://github.com/javafx-maven-plugin/javafx-maven-plugin/issues/81 and https://help.ubuntu.com/community/EnvironmentVariables#A.2Fetc.2Fprofile.d.2F.2A.sh – tar Mar 26 '18 at 13:10
  • _"but I've seen exactly the same error with a 64 bit computer, 64 bit Windows and 64 bit version of my application."_ Was a 32bit Java installed by any chance? If possible, configure the installer to detect the bitness of Java in JAVA_HOME on the machine, and then decide which version of the application to install. – Max Vollmer Mar 26 '18 at 13:17
  • JVM specific? Have you checked if it occurs only with the Oracle one or OpenJDK? – Paizo Mar 26 '18 at 14:27
  • Can you check the `Event Logs` in the `Administrative Tools` and see if you find information related to this? – Tarun Lalwani Mar 26 '18 at 15:50
  • Interesting that it's either `bin\server\jvm.dll` or `bin\client\jvm.dll` that it's failing to find. In each case, is the other one there instead? If so, one possibility is that the JVM is trying to auto-detect if the machine 'server class'. This is normally done based on the [CPU count](https://docs.oracle.com/javase/8/docs/technotes/guides/vm/server-class.html). – df778899 Mar 26 '18 at 20:22
  • Just go to command line and check does your machine runs on 64bit 'java -d64 -version'. Looks like in first screenshot it looks for files in 'Program Files' and second 'Program Files (x86)' this directory is for 32 bit binaries. Can you check do you have these dll files under C:\Program Files (x86)\Dashman\runtime\bin\client\jvm.dll if file is there then probably you should add this 'C:\Program Files (x86)\Dashman\runtime\bin' to the 'set PATH=%PATH%;C:\Program Files (x86)\Dashman\runtime\bin' – Saulius Next Mar 27 '18 at 12:36
  • @MaxVollmer: no, it was a 64 bit version of my application. I have no idea how to configure javafxpackager to build an installer that would detect the bitness of Java. Do you? – Pablo Fernandez Mar 27 '18 at 16:54
  • @Paizo: this is happening with Oracle's Java which I'm packaging with my application. – Pablo Fernandez Mar 27 '18 at 16:55
  • @tar: I've read https://github.com/javafx-maven-plugin/javafx-maven-plugin/issues/81 when I was building my installer to make the 32 bit version. But this is happening with a 64 bit version on a 64 bit computer, so, I don't think it's a bit missmatch. – Pablo Fernandez Mar 27 '18 at 16:57
  • @SauliusNext: my computer doesn't have java its PATH. It has both, 64 bit and 32 bit java installed, and I pick the one I want to build the 64 bit and 32 bit installer respectively. The problem is happening with a 64 bit version of my app, built with a 64 bit Java, running on a 64 bit processor with a 64 bit version of Windows 10 installed on it. This problem as far as I can see is not an architectural mismatch. The dll file is present and I don't want users of my app to have to modify their paths. That's not very user friendly. – Pablo Fernandez Mar 27 '18 at 17:08
  • Could you try to run in cmd this application as a jar? CMD: java -jar "HelloWorld.jar". Which this method you will get additional informations about exceptions. – Maciej Pulikowski Mar 27 '18 at 22:43
  • @MaciejPulikowski: which java do you think I should run this with? – Pablo Fernandez Mar 30 '18 at 09:41
  • Same java and computer where error occure. – Maciej Pulikowski Mar 30 '18 at 20:24

2 Answers2

3

Could it be that you are affected by JDK-8191176 : JavaFX Self-Contained Application fails with error "Failed to find library: jvm.dll" which was affecting 8u151 and was fixed in 8u162.

Verfied again on Windows 10 Enterprise build 1709 with respective JDK versions and could confirm the issue as reported. A "Failed to find library: jvm.dll" and subsequent error dialogs popped up as described when checked with JDK 8u151/8u152.

Perhaps you can check what happens when you run with 8u162 or newer.

Karol Dowbecki
  • 43,645
  • 9
  • 78
  • 111
  • I am going to repeat the check just in case I got something mixed up, but as far as I know, it was happening with a binary built with JDK 8u162. – Pablo Fernandez Mar 27 '18 at 17:22
  • I had something similar with just a minor java version between client and build, just to double check can you build it with the very same java version to check if it is then a jdk issue? – Paizo Mar 27 '18 at 19:35
  • @Karol: I've just rebuilt it with Java 1.8.0_162, 64 bit and it's causing the same issue. So it wasn't a 8u152 issue that got solved. At least not for me. – Pablo Fernandez Mar 27 '18 at 22:06
  • @Paizo: the same Java version as what? – Pablo Fernandez Mar 27 '18 at 22:06
  • suppose the client has version 1.8.0_123 trying build the app with the same version still give the issues? – Paizo Mar 28 '18 at 08:11
  • @Paizo: the client doesn't have any Java installed. My application is distributed with its own copy of Java. – Pablo Fernandez Apr 03 '18 at 09:21
  • @Paizo I wonder if you could try starting the application using a different user account on the same client PC? This would narrow down to either a system or account setup issue. Windows tends to be weird e.g. `HKEY_CLASES_ROOT\Directory\shell` used to override `cmd` start dir which will confuse the JVM (native code seeing different `user.home` than Java code). – Karol Dowbecki Apr 03 '18 at 10:12
  • @pupeno was it the Java version? – Karol Dowbecki May 23 '18 at 08:24
  • @KarolDowbecki what do you mean? – Pablo Fernandez May 23 '18 at 10:47
  • @KarolDowbecki: if you are asking if it was fixed in a later Java version, I don't know, I'm stuck in Java 8 because Oracle stopped supporting 32 bit. I workarounded this problem by building my own installer with Wix. – Pablo Fernandez May 23 '18 at 10:54
1

This is bit wrong error message, actually means that some of depend .dll was not found. One of jvm.dll's dependencies not jvm.dll itself.

From https://bugs.openjdk.java.net/browse/JDK-8191176 :

For anyone seeking a solution, I extracted the "msvcr100.dll" from Java and added it to my application source. When using the JavaPackager when building my JavaFX project (using InnoSetup), I simply add these lines in the setup.iss script in order to place the file next to the application.exe :

[Files] 
Source: "YOUR_APPLICATION\app\msvcr100.dll"; 
DestDir: "{app}"; 
Flags: ignoreversion 
Alex Chernyshev
  • 1,719
  • 9
  • 11