[SOLVED] Hardcode JVM Path

Get help with installation and configuration of OWS. Please post specific bug reports, pull requests, or source code extensions on github.
hvhv19
Posts: 5
Joined: 28 Sep 2020, 13:40

[SOLVED] Hardcode JVM Path

Post by hvhv19 »

Hi guys,

I am trying to put together a response.varfile to pass to my infrastructure team.
Can someone tell me how I can point OpenWebstart to use a specific JVM.
We need this to be our own provided one as it will have some certificates injected into the java keystore.
It is not clear to me what JVM Cache means as I have tried that property and it doesn't seem to do anything.

Many thanks,
Horia

Andreas Ehret
Posts: 81
Joined: 25 Mar 2020, 12:21

Re: Hardcode JVM Path

Post by Andreas Ehret »

The information about the available JVMs is stored in a file called cache.json that can be found in the .cache/icedtea-web/jvm-cache/ folder where also the cached JVMs of your installation reside. You can use the configuration property "ows.jvm.manager.cache.dir" in your response.varfile to redirect to another jvm cache directory as described here.

Stephan Classen
Posts: 232
Joined: 27 Mar 2020, 09:55

Re: Hardcode JVM Path

Post by Stephan Classen »

Also it is possible to host your own JVM download server.
see: https://github.com/karakun/OpenWebStart ... oad-server

hvhv19
Posts: 5
Joined: 28 Sep 2020, 13:40

Re: Hardcode JVM Path

Post by hvhv19 »

Hi guys,

Much appreciated your fast replies. I did create my own response file and it does install in the custom location I provide in it.
However ows.jvm.manager.cache.dir=C\:\\Users\\user_h\\java_jdks does not seem to work.
I am not sure what I am omitting or doing wrong, this is how the response file looks like:

# install4j response file for OpenWebStart 1.2.1
installationDate$Long=1599205944604
sys.adminRights$Boolean=true
sys.fileAssociation.extensions$StringArray="jnlp","jnlpx"
sys.fileAssociation.launchers$StringArray="313","313"
sys.installationDir=C\:\\Users\\user_h\\custom_openwebstart_location\\OpenWebStart
sys.languageId=en
userMode$Integer=1
ows.update.strategy.settings=NEVER
ows.update.strategy.launch=NEVER
ows.jvm.manager.updateStrategy=DO_NOTHING_ON_LOCAL_MATCH
ows.jvm.manager.cache.dir=C\:\\Users\\user_h\\java_jdks


The java_jdk folder just has jdk-15 which has been preloaded with the certificates we need.
All of it is done on Windows 10 VMs

Thanks again for any help/suggestions,
Horia

Stephan Classen
Posts: 232
Joined: 27 Mar 2020, 09:55

Re: Hardcode JVM Path

Post by Stephan Classen »

I suspect, the formatting of the path to the cache dir may be incorrect.

@Janak
Can you test this on Windows and see if the path is resolved correctly using the above syntax

hvhv19
Posts: 5
Joined: 28 Sep 2020, 13:40

Re: Hardcode JVM Path

Post by hvhv19 »

Hi,

I tried this as well which does resolve if I just enter it in Windows Explorer:

ows.jvm.manager.cache.dir="C:\Users\user_h\java_jdks"

Is there anywhere I could see some log saying if it could find or not find the path?

hvhv19
Posts: 5
Joined: 28 Sep 2020, 13:40

Re: Hardcode JVM Path

Post by hvhv19 »

It seems like no matter what path I try, even after I edit the response file after installation, just to test what path works, it still won't pick it up.

It instead still tries to download a jdk11 from azul.

Just double checking: in case it does pick up the cache.dir correctly: are the jvms going to show up in the JVM Manager from the start or will that only happen once I try opening a jnlp file?

hvhv19
Posts: 5
Joined: 28 Sep 2020, 13:40

Re: Hardcode JVM Path

Post by hvhv19 »

Thank you guys for all the effort. I think I figured it out so on top of the path being incorrect there was another step missing.

I had to modify the cache.json file that is in the JVM Cache folder to point it manually to:

{
"runtimes": [
{
"version": "15",
"vendor": "Oracle Systems, Inc.",
"javaHome": "file:///C:/Users/user_h/java_jdks/jdk-15/",
"active": true,
"os": "WIN64",
"managed": true,
"lastUsage": "2020-10-02T11:15:01.753"
}
]
}

Now it indeed picks it up and things run as expected.

Stephan Classen
Posts: 232
Joined: 27 Mar 2020, 09:55

Re: Hardcode JVM Path

Post by Stephan Classen »

Greate to hear that it is working.

You should change your entry in the cache.json to read ' "managed": false '.
This will tell OWS that the JDK was not downloaded by the JVM Manager.
Main effect this flag has is that when a managed JVM is removed from the JVM Manager it is also physically deleted from the drive.
Unmanaged JVMs will not be deleted when removed from the list.

Post Reply