J
J
Jadavin2019-06-28 13:34:25
Java
Jadavin, 2019-06-28 13:34:25

How to run jar wrapped in exe using separate jdk?

Hello! I have a Java program which is wrapped in an exe. There are no sources, jar'a too. For a number of reasons, I need to run it using a separately downloaded open source jdk 8 (it does not have an installer, and it does not register itself in the system), via the command line. The program was not written by me, so I can’t just compile and run the jar.

In this regard, the question is: how to use the command line to transfer this exe to start that JVM? which is not registered. That is, hypothetically, something like this:

$ java -exe Program.exe

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Antony, 2019-06-28
@Jadaw1n

Most likely, the system takes the jvm binary through the path environment variable. Redefine the variable accordingly.
An open console (or batch file) inherits variables from the system ones (or from what launched them), a program opened in the console or batch file inherits the environment variables that were in the console. Accordingly, in the batch file you prescribe a redefinition of the path and run.
Example

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question