Can you install OpenHAB2 & OpenHAB3 on same windows machine?

Is it possible to run OpenHAB2 & OpenHAB3 on the same windows machine? I know when setting the system variable JAVA_HOME, OH2 is Java8 and OH3 is JAVA11.

Is there a way to do like JAVA_HOME2 & JAVA_HOME3 and make it work somehow where both will run at the same time and ill just change the ports to they don’t conflict?

I had to switch to my always on windows server because my RPi4B was not able to handle OpenHAB well enough for me. Whenever I had to reboot it took 35+ minutes for everything to settle out and it be usable. OpenHAB2 installed on Windows is up in running in less than 5 minutes.

When OH3 came out I tried to migrate on a RPI but some of my rules would not work properly, I didn’t have enough time to mess with them, so I kind of gave up on it. Now I have some time and want to try and migrate to OH3, but I cannot run both at the same time without one of them crashing.

Thanks guys.

Isn’t JAVA_HOME just an ( system ) environment variable ?
I would assume that setting JAVA_HOME pointing to two different locations ( one for OH2 and one for OH3 ) in two different startup batch files would be your least problem.
Separating service ports for http/https also should work. But depending on which other service you use there might be other port conflicts which only can be resolved in a way that this service can be offered only by one of the instances ( e.g. hardware COM ports for ZWAVE, ZIGBEE ). I think that also applies to UPNP service ( others may correct me if I am wrong ).
Did you think about preparing OH3 on a different host and switching from OH2 to OH3 on your windows machine once preparation is done ?

It is, but i’m not sure how to separate them so they point to two different locations ( which config files to exit to change JAVA_HOME to point to the new JAVA_HOME3 which will be the system variable for the OH3 service)…

As of now I am using a dedicated RPi that runs MQTT, influx, and zigbee2mqtt, and i’m loving it. No waiting for devices to reload when I reboot the system, and I am looking to running ZWavejs2MQTT on the RPi too. (Z-Wave is fine when starting up, just temporarly while using both OpenHAB system)

I don’t have anything powerful enough. I could maybe try a RPi again now that MQTT, influx, zigbee and zwave will be offloaded to designated RPi’s (not sure how much resources those used)

have a look to the runtime\bin folder.
There are several batch scripts.
I think the interesting ones are: ( start.bat ), karaf.bat, setenv.bat.
start.bat starts karaf.bat which calls setenv.bat.

You could simply setup two Linux VM‘s on your Windows machine …

I’ve tried this before originally with openHAB3 and Ubuntu, and it seems very slow and did not respond very well at all

I’ll check that out. Thanks !

It depends on the power of your Windows machine and the resources given to the VM.
Other possibility would be to run Linux as Host system on that machine as well and use it as hypervisor for your Ubuntu VM‘s.
Or you could try with two different docker containers….
The link is about running on a NAS, but this makes no difference…