B4J Question b4j bridge Pi Zero W query

gpa

Member
Licensed User
Longtime User
Hi...

Trying to run b4j bridge on a pi zero. I realise this may simply not be possible, arm6 and java are not a good mix.

I have java 11 installed - from Azul...

Here's the error:

root@raspberrypi:/home/pi/bridge# java -version
openjdk version "11.0.8" 2020-07-14 LTS
OpenJDK Runtime Environment Zulu11.41+75-CA (build 11.0.8+10-LTS)
OpenJDK Client VM Zulu11.41+75-CA (build 11.0.8+10-LTS, mixed mode)
root@raspberrypi:/home/pi/bridge#

root@raspberrypi:/home/pi/bridge# java -jar b4j-bridge.jar
main.main (java line: 28)
java.lang.ClassFormatError: Incompatible magic value 1450507819 in class file jdk/internal/reflect/NativeMethodAccessorImpl
at java.base/jdk.internal.reflect.ReflectionFactory.newMethodAccessor(ReflectionFactory.java:214)
at java.base/java.lang.reflect.Method.acquireMethodAccessor(Method.java:632)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:108)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:95)
at b4j.example.main.main(main.java:28)

Any thoughts anyone?

Thanks....
 

gpa

Member
Licensed User
Longtime User
Sadly, after install, and selecting it
java -version
returns
illegal instruction

So I guess that one isn't ARM6 compatible.

Anyone know of a b4j compatible java 8 maybe? That could work.
 
Upvote 0

hwatech

Member
Licensed User
Longtime User
this may not work for you but I use freebsd on all of my pi projects (and all my server projects for that matter) and I don't have any issues with Java in general using openjdk, but I have never run b4j bridge, so I can't speak to that. Just thought I'd throw it out there

If you did want to try it, I could share links and such that will make it a much simpler transition, just let me know
 
Upvote 0

gpa

Member
Licensed User
Longtime User
Interesting - didn't realise there was an ARM6 version. And never tried it - straight Unix was ages ago for me!
so - if there's a pi zero W image with java that's available - that'd be great to try! And, well, fun!
so - yes please!
 
Upvote 0

hwatech

Member
Licensed User
Longtime User
Here are some basic links that will get you going

freebsd.org
ftp.freebsd.org/pub/FreeBSD/releases/ISO-IMAGES/13.0/
 
Upvote 0

hwatech

Member
Licensed User
Longtime User
once installed, you'll need to install Xorg (X11) for gui programs

Not sure how much freebsd you might know... The package manager is pkg, in the same way that apt would work, so to install xorg use this command:

B4X:
pkg install xorg   'it will run for a while installing many packages but that should install everything
or
pkg xorg-minimal  'if you're short on space on the sdcard

The first time you run pkg it will update and get the lists and then move on to installing whatever pkg you wanted

as far as java is concerned, you can find which ones are available, using this command

there a number of openjdk available in the ports tree, to search run this command
B4X:
pkg search openjdk

if you need access to the GPIO check this link:

I think you'll find a number of advantages over Rasbian, the biggest one being speed and security

feel free to shoot me a PM if you have any questions... I am actually in the process creating my own image that has everything ready to go for B4J but I haven't had a lot of time recently. I don't think it will take me much longer to finish

Larry
 
Upvote 0
Top