Java on non-openHABian

Tags: #<Tag:0x00007f617048ce88>

FYI in case you don’t know you can run openhabian menu system on other Linux besides raspian.

1 Like

Please no one reply to this post as it is off topic, thanks.

FYI no you can’t do That when it is a 64bit ARM device. Java fails to install on many new ARM devices and I raised this in a GitHub issue almost 2 years ago here…

The changes needed to make it work are funnily sitting in the project disabled/ commented out. I begun to make Changes for a PR and they are still sitting here.

64-bit ARM support has been added for devices that can be used with it (which does not currently include the RPi3 or RPi4). Please try to use the new install routine and see if it still fails, if it does let me know and I can help to fix it.

This is the entire reason for this test to find and fix bugs. In this case it would likely be a bug as 64-bit Java is now supposed to install correctly. Additionally, the PR changes you mentioned are no longer applicable as the code has changed greatly since they were made.

1 Like

I know of two users that have been playing with an Odroid C4 last week that had issues using openhabian on top of Debian/Ubuntu images. Most non PI users have been using DietPI and Armbian as they offer to install openhab for you… I checked the scripts that Openhabian uses and yes a lot of work has been done, a BIG THANKYOU to all that have contributed…

I just tried it 5 minutes ago, and yes it still fails to install Java for the main ubuntu 18-04-3 LTS minimal image for an Odroid C2. I was using STABLE branch for the below.

First tried option 3 and that failed to create a working Openhab with complaints that there was no JAVA installed (I kept the console output saved to a txt file).

Then I tried option 63 to manual install java, this is the output and it appears curl is not installed.

root@odroid:~# openhabian-config
2020-06-01_09:09:16_UTC [openHABian] Checking for root privileges... OK
2020-06-01_09:09:16_UTC [openHABian] Loading configuration file '/etc/openhabian.conf'... OK
2020-06-01_09:09:16_UTC [openHABian] openHABian configuration tool version: [stable]v1.5-588(2c8471e)
2020-06-01_09:09:16_UTC [openHABian] Checking for changes in origin branch stable ... OK
2020-06-01_09:09:18_UTC [openHABian] Switching to branch stable ... OK
2020-06-01_09:09:48_UTC [openHABian] Updating Linux package information ...
2020-06-01_09:10:25_UTC [openHABian] Updating Linux package information ...
2020-06-01_09:11:24_UTC [openHABian] Updating Linux package information ...
2020-06-01_09:11:25_UTC [openHABian] Installing Java Zulu 32-Bit OpenJDK... /opt/openhabian/functions/java-jre.bash: line 149: curl: command not found

gzip: stdin: unexpected end of file
tar: Child returned status 1
tar: Error is not recoverable: exiting now
FAILED
2020-06-01_09:11:43_UTC [openHABian] Checking for default openHABian username:password combination... SKIPPED (method not implemented)
2020-06-01_09:11:43_UTC [openHABian] We hope you got what you came for! See you again soon ;)

apt install curl worked to install curl with default repos untouched and then tried again, this time I got a working Openhab. Frontail installed smoothly too. Lastly I changed to MASTER and upgraded the java to 32bit version 11 and it worked. Will move some bindings and files across to do some testing over the next few days.

1 Like

OH3 will fully support Java 11. I run OH2.5 on Java11, BUT: it won‘t work out-of-the-box if you use bindings that have serial communication or use jython. JavaScript scripting works though.

Edit: my comment regarding serial communication is valid only for windows.

Please check back with @5iver, he said to use OpenJDK11 with jython 2.7.2 with no problems.

I didn’t closely follow this nrjserial stuff, does 2.5 still use some old version to conflict with Java 11 because of core freeze ? What should I mention in the announcement post to NOT open as threads because it is a known issue ? Any serial related exception ?
[ if that means you cannot run anything-to-use-serial because of that I’d put a big question mark behind the core freeze as it would IMHO mean only very few people can go Java 11 today but everyone has to use it right from the start with OH3 ]

@wborn reversioned 5.2.1 as nrjavaserial-3.15.0.OH2.jar. I’ve been using it with Java 11 with no issues.

2 Likes

Exactly. But this requires manual upgrade for OH2.5, therefore my warning „will not work out-of-the-box“

There was a change around S1760, where there is an error when using the manual Jython installation, but the beta bundle works fine.

More detail at the end of this comment…

1 Like

Well if you don’t run the unattended install you of course need to install prerequisites first, one by one. That’s menu 10 for the most part - curl is among “basic can’t be wrong” packages.
But to be safe you should run openhabian-config unattended, did you ?
Honestly I don’t know if that works as I’ve never tried on anything but Raspbian, but in theory that should do.

I followed the install guide here so if your telling me it needs to be started as unattended the guide needs updating.

I also have issues with samba not working, have not had time to narrow the cause yet but I suspect it may be because there is no openhabian user account created.

Well, I just upgraded to Ubuntu Server 20.04 and I thought I’d try OpenJDK 11
I removed Oracle JDK 8 and installed OpenJDK 11 using apt
I don’t use any of the plug-ins or serial communications.

Openhab started right up and runs like nothing happened. :sunglasses:

1 Like

although this was in the log

smitopher@myth-server:~$ sudo systemctl status openhab2.service
[sudo] password for smitopher:
● openhab2.service - openHAB 2 - empowering the smart home
     Loaded: loaded (/usr/lib/systemd/system/openhab2.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2020-06-02 13:50:37 CDT; 1min 5s ago
       Docs: https://www.openhab.org/docs/
             https://community.openhab.org
   Main PID: 1122 (java)
      Tasks: 228 (limit: 9298)
     Memory: 782.0M
     CGroup: /system.slice/openhab2.service
             └─1122 /usr/bin/java -Dopenhab.home=/usr/share/openhab2 -Dopenhab.conf=/etc/openhab2 -Dopenhab.runtime=/usr/share/openhab2/runtime -Dopenhab.userdata=/var/lib/openhab2 -Dopenhab.logdir=/var/log/openhab2 -D>

Jun 02 13:50:37 myth-server systemd[1]: Started openHAB 2 - empowering the smart home.
Jun 02 13:50:41 myth-server karaf[1122]: org.ops4j.pax.url.wrap [org.ops4j.pax.url.commons.handler.HandlerActivator] DEBUG : Handler for protocols [wrap] started
Jun 02 13:50:59 myth-server karaf[1122]: Warning: Nashorn engine is planned to be removed from a future JDK release
Jun 02 13:50:59 myth-server karaf[1122]: Warning: Nashorn engine is planned to be removed from a future JDK release
Jun 02 13:50:59 myth-server karaf[1122]: Warning: Nashorn engine is planned to be removed from a future JDK release
Jun 02 13:50:59 myth-server karaf[1122]: Warning: Nashorn engine is planned to be removed from a future JDK release
Jun 02 13:50:59 myth-server karaf[1122]: Warning: Nashorn engine is planned to be removed from a future JDK release
Jun 02 13:50:59 myth-server karaf[1122]: Warning: Nashorn engine is planned to be removed from a future JDK release

Yes, we need to replace Nashorn at some time. But in Java 11 it‘s only a deprecation warning and everything works as expected.

These are suppressed in 2.5.6-SNAPSHOT after backporting the “fix” from OH3:

On windows 10 I got same error message and it does not matter witch Java version OpenJDK or Zulu I use:

Launching the openHAB runtime...
Listening for transport dt_socket at address: 5005
org.ops4j.pax.url.wrap [org.ops4j.pax.url.commons.handler.HandlerActivator] DEBUG : Handler for protocols [wrap] started

                          __  _____    ____
  ____  ____  ___  ____  / / / /   |  / __ )
 / __ \/ __ \/ _ \/ __ \/ /_/ / /| | / __  |
/ /_/ / /_/ /  __/ / / / __  / ___ |/ /_/ /
\____/ .___/\___/_/ /_/_/ /_/_/  |_/_____/
    /_/                        2.5.6-SNAPSHOT
                               Build #138

Hit '<tab>' for a list of available commands
and '[cmd] --help' for help on a specific command.
Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown openHAB.

openhab> Exception in thread "OkHttp Dispatcher" java.lang.IllegalArgumentException: unsupported auth scheme: [Basic realm="gSOAP Web Service"]
        at com.burgstaller.okhttp.digest.DigestAuthenticator.findDigestHeader(DigestAuthenticator.java:199)
        at com.burgstaller.okhttp.digest.DigestAuthenticator.authenticate(DigestAuthenticator.java:164)
        at com.burgstaller.okhttp.CachingAuthenticatorDecorator.authenticate(CachingAuthenticatorDecorator.java:35)
        at okhttp3.internal.http.RetryAndFollowUpInterceptor.followUpRequest(RetryAndFollowUpInterceptor.kt:213)
        at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:102)
Exception in thread "OkHttp Dispatcher" Exception in thread "OkHttp Dispatcher"         at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:112)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:87)
        at com.burgstaller.okhttp.AuthenticationCacheInterceptor.intercept(AuthenticationCacheInterceptor.java:49)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:112)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:87)
        at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.kt:184)
        at okhttp3.RealCall$AsyncCall.run(RealCall.kt:136)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.base/java.lang.Thread.run(Unknown Source)
java.lang.IllegalArgumentException: unsupported auth scheme: [Basic realm="gSOAP Web Service"]
        at com.burgstaller.okhttp.digest.DigestAuthenticator.findDigestHeader(DigestAuthenticator.java:199)
        at com.burgstaller.okhttp.digest.DigestAuthenticator.authenticate(DigestAuthenticator.java:164)
        at com.burgstaller.okhttp.CachingAuthenticatorDecorator.authenticate(CachingAuthenticatorDecorator.java:35)
        at okhttp3.internal.http.RetryAndFollowUpInterceptor.followUpRequest(RetryAndFollowUpInterceptor.kt:213)
        at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:102)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:112)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:87)
        at com.burgstaller.okhttp.AuthenticationCacheInterceptor.intercept(AuthenticationCacheInterceptor.java:49)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:112)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:87)
        at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.kt:184)
        at okhttp3.RealCall$AsyncCall.run(RealCall.kt:136)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.base/java.lang.Thread.run(Unknown Source)
java.lang.IllegalArgumentException: unsupported auth scheme: [Basic realm="gSOAP Web Service"]
        at com.burgstaller.okhttp.digest.DigestAuthenticator.findDigestHeader(DigestAuthenticator.java:199)
        at com.burgstaller.okhttp.digest.DigestAuthenticator.authenticate(DigestAuthenticator.java:164)
        at com.burgstaller.okhttp.CachingAuthenticatorDecorator.authenticate(CachingAuthenticatorDecorator.java:35)
        at okhttp3.internal.http.RetryAndFollowUpInterceptor.followUpRequest(RetryAndFollowUpInterceptor.kt:213)
        at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:102)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:112)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:87)
        at com.burgstaller.okhttp.AuthenticationCacheInterceptor.intercept(AuthenticationCacheInterceptor.java:49)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:112)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:87)
        at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.kt:184)
        at okhttp3.RealCall$AsyncCall.run(RealCall.kt:136)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.base/java.lang.Thread.run(Unknown Source)
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.jboss.netty.util.internal.ByteBufferUtil (file:/C:/openhab2/userdata/cache/org.eclipse.osgi/275/0/.cp/lib/netty-3.9.0.Final.jar) to method java.nio.DirectByteBuffer.cleaner()
WARNING: Please consider reporting this to the maintainers of org.jboss.netty.util.internal.ByteBufferUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

Which binding is not working? Unfortunately there is not much in this stack trace. If you can‘t say which binding, please provide a list of all installed bindings and additionally the output of bundle:list -s | grep 275. Thanks.

I sent debug files in a message.

Look like you ran into both problems I mentioned here: Java on non-openHABian

Both are known and workarounds are available. You can use the search on how to install @5iver PR for jython. And I‘m quite sure there is also a thread about updating nrjavaserial. Report back if there are further problems.

It does not work for me.
Now I try to use what was working before trying Java11.
I reverted back everything. Despite of it when I start second time rule enige with org.openhab.core.automation.module.script.rulesupport-2.5.0-SNAPSHOT.jar in addon folder Rule engine gives the following error in the attached file.
ruleengine.log (139.1 KB)

After that I stop OH, delete this file from addon folder. Empty Catch and TMP folders in Userdata.
Than I restart OH twice and activaty my yard.py rules and it loads succefully.
Here is the second log: ruleengine2.log (14.6 KB)