0

I have a installer with a JRE embebed, that is, it have a jvm.dll instead a java.exe. What i would like to do is to execute a Java app (a jar file) using jvm.dll instead of java.exe.

Is it that possible?

Víctor
  • 416
  • 5
  • 15
  • 1
    Without further information on what you have, check this https://docs.oracle.com/en/java/javase/11/docs/specs/jni/invocation.html – Federico klez Culloca Apr 30 '19 at 08:46
  • My Java program is a Websocket server program deployed as a jar file. I can run this program like this java -jar myserver.jar, that is, using java.exe. The problem is that myserver.jar is installed with a installer in windows (.exe) and this installer also install a embebed JRE. This embebed JRE does not have java.exe. Instead it has dlls like jvm.dll. java.exe is a wrapper of jvm.dll. What I woul like is to execute myserver.jar using this jvm.dll distribute with my installer instead of using the JRE installed in the diferents computers. – Víctor Apr 30 '19 at 09:01
  • What installer is that? Is it a custom one or something like javapackager? – Federico klez Culloca Apr 30 '19 at 09:32
  • It is a custom one, using Inno Setup : http://www.jrsoftware.org/ – Víctor Apr 30 '19 at 09:38

2 Answers2

1

It is possible.

You have to write C/C++ program to achieve it (or in other language able to do native calls).

talex
  • 17,973
  • 3
  • 29
  • 66
0

I think that's not possible, unless you don't embed your java application in a C++ application.

Further reading:

Difference between java.exe, javaw.exe and jvm.dll

Embed Java into a C++ application?

tarabor
  • 166
  • 1
  • 7