Other [IOT] problem with orangepi

derez

Expert
Licensed User
Longtime User
I try to run a b4j non-ui application using b4j-bridge.
I get this error - "Unsupported major.minor version 52.0" :
Waiting for debugger to connect...
java.lang.UnsupportedClassVersionError: org/eclipse/jetty/server/HttpConfiguration$Customizer : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:792)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:190)
at anywheresoftware.b4a.shell.Shell.getCorrectClassName(Sh
ell.java:504)
at anywheresoftware.b4a.shell.Shell.createObject(Shell.java:491)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:244)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:159)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:93)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:90)
at b4j.example.main.<clinit>(main.java:17)
Exception in thread "main"
java.lang.ExceptionInInitializerError
Caused by: java.lang.RuntimeException: java.lang.UnsupportedClassVersionError: org/eclipse/jetty/server/HttpConfiguration$Customizer : Unsupported major.minor version 52.0
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:114)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:90)
at b4j.example.main.<clinit>(main.java:17)
Caused by: java.lang.UnsupportedClassVersionError: org/eclipse/jetty/server/HttpConfiguration$Customizer : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:792)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:190)
at anywheresoftware.b4a.shell.Shell.getCorrectClassName(Shell.java:504)
at anywheresoftware.b4a.shell.Shell.createObject(Shell.java:491)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:244)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:159)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:93)
... 2 more
The application code is simple:
B4X:
'Non-UI application (console / server application)
#Region  Project Attributes
    #CommandLineArgs:
    #MergeLibraries: True
#End Region

Sub Process_Globals

    Private srvr As Server
End Sub

Sub AppStart (Args() As String)
    Try
        srvr.Initialize("srvr")
        srvr.Port = 53500
        srvr.AddHandler("/reboot", "Reboot", False)
        srvr.AddHandler("/shutdown", "shutdown", False)
        srvr.Start
        Log("Server started")
        StartMessageLoop
    Catch
        Log("Not started !")
    End Try
End Sub

The same problem shows when running directly from the orangepi.
Help ?
 
Last edited:

derez

Expert
Licensed User
Longtime User
I have found that I have java 7 in the orangepi.
I have a problem of space so I need to remove it before installing 8.
How do I uninstall java 7 which came in the raspbian ?
 
Upvote 0

derez

Expert
Licensed User
Longtime User

Attachments

  • java.png
    java.png
    33.6 KB · Views: 215
Last edited:
Upvote 0

dar2o3

Active Member
Licensed User
Longtime User
To select the version of java and javac use these commands.

B4X:
sudo update-alternatives --config javac
sudo update-alternatives --config java
 
Upvote 0
Top