[SOLVED] Manually Upgrade com.google.gson from 2.7.x to 2.8.x in OH 2.4

I’m running OH 2.4 and need to upgrade my com.google.gson from 2.7.x to 2.8.x.

I tried dropping it in the Add-On’s folder with the same result; both installed. I tried to install it with this syntax with the same result; both installed.

bundle:install http://central.maven.org/maven2/com/google/code/gson/gson/2.8.5/gson-2.8.5.jar

The newer version is needed for the DarkSky Binding. I have them both running but I’m seeing weirdness now.

Is there a way to manually replace com.google.gson JAR? Where is it located?

openhab> bundle:list -s | grep gson
 21 │ Active    │  80 │ 2.7.0.v20170129-0911   │ com.google.gson
268 │ Resolved  │  80 │ 2.8.5                  │ com.google.gson

Best, Jay

can’t you

bundle remove 21

then

bundle start 268

???

Squid

1 Like

This will work but it won’t survive a cleanup of \cache and \tmp directories since the new gson 2.8.x file resides in one of them.

Looking for a more of a permanent placement if all possible?

Best, Jay

could you not place it in the addon folder for persistence?

I tried to place it in the addon folder but it did NOT load for some reason.

Best, Jay

Hey @KidSquid - Thank you very much!

I decided to use your logic to see if it would work step by step and it did.

  • Stopped/Removed gson 2.8.x version
  • Dropped gson 2.8.x version into AddOn’s
  • Stopped/Removed 2.7.x version
openhab> bundle:list -s | grep gson
269 │ Active    │  80 │ 2.8.5                  │ com.google.gson

This will survive a reboot and hopefully it will load properly during a \cache and \tmp cleanup the next time I do it.

Best, Jay

Awesome…glad to hear it worked…if you get a sec, mark it solved so it will be easy for others to find.

Squid :squid:

1 Like

Well I blew away \cache and \tmp this morning and did a clean restart and both are online again.

Based on the low object number of the older one; that 2.7.x version must be needed for the core of OH 2.4 is my only guess.

Oh well, we tried . . .

openhab> list -s | grep gson
 21 │ Active    │  80 │ 2.7.0.v20170129-0911   │ com.google.gson
209 │ Active    │  80 │ 2.8.5                  │ com.google.gson

Best, Jay