B4J Question Web server with B4J

Andie

Member
Licensed User
Longtime User
To build a web server with B4J there are some code examples in the forum:
https://www.b4x.com/android/forum/threads/server-building-web-servers-with-b4j.37172/
and
https://www.b4x.com/android/forum/t...p-to-your-b4j-server-over-the-internet.37201/

The code worked approx. three years ago. Now I tried to make a new release with the latest B4J version. But when I start the jar file in the command line
java -jar FileServer.jar
it says:
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: b4j/example/main has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0

What can I do?
 

Andie

Member
Licensed User
Longtime User
I just added
C:\Program Files (x86)\Java\jdk-14.0.1\bin\
to the Path system variable. So, the java.exe and the javac.exe belong to the same java version, which I use for B4J. But unfortunately, the same message as above appears.

In addition, during the release process I get these log messages:
2020-08-12 14:44:06.642:INFO::main: Logging initialized @298ms to org.eclipse.jetty.util.log.StdErrLog
2020-08-12 14:44:06.862:INFO:eek:ejs.Server:main: jetty-9.4.z-SNAPSHOT; built: 2018-05-03T15:56:21.710Z; git: daa59876e6f384329b122929e70a80934569428c; jvm 14.0.1+7
2020-08-12 14:44:06.938:INFO:eek:ejs.session:main: DefaultSessionIdManager workerName=node0
2020-08-12 14:44:06.938:INFO:eek:ejs.session:main: No SessionScavenger set, using defaults
2020-08-12 14:44:06.944:INFO:eek:ejs.session:main: node0 Scavenging every 660000ms
2020-08-12 14:44:06.955:INFO:eek:ejsh.ContextHandler:main: Started o.e.j.s.ServletContextHandler@3d921e20{/,file:///D:/B4J/code_server/ServerHelloWorld/Objects/www/,AVAILABLE}
2020-08-12 14:44:06.960:INFO:eek:ejs.AbstractNCSARequestLog:main: Opened D:\B4J\code_server\ServerHelloWorld\Objects\logs\b4j-2020_08_12.request.log
2020-08-12 14:44:07.076:INFO:eek:ejs.AbstractConnector:main: Started ServerConnector@62ffcb8d{HTTP/1.1,[http/1.1]}{0.0.0.0:8888}
2020-08-12 14:44:07.077:INFO:eek:ejs.Server:main: Started @739ms
Server started
 
Upvote 0
Top