B4J Question How can i run my compiled jRDC.jar in my windows Server ? IF jRDC.jar isn't running

Rodolfo Moguel

New Member
i want to connect Mysql with b4a app
i try to run with differents javas , and i try too with java to exe software.

Sending me this Error:
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
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
 

netsistemas

Active Member
Licensed User
Longtime User
May be, create a .bat and put this code:

B4X:
@echo off
cls
cd C:\pro\java\B4J\Proyectos\jRDC_v2\Objects
"C:\Program Files\Java\jdk-11.0.1\bin\java.exe" -jar jRDC.jar
pause

In windows server, i don't know if is necesary open session or other necesay pass
 
Upvote 0

Rodolfo Moguel

New Member
52.0 = Java 8
53.0 = Java 9+

Thanks Erel and Thanks Roberto for your support
but i found this :

set JAVA_HOME=C:\Java\jdk-11.0.1
set APP_PATH=%~p1
set APP_NAME=%~nx1

cd %APP_PATH%
%JAVA_HOME%\bin\java.exe --module-path %JAVA_HOME%\javafx\lib --add-modules=javafx.controls,javafx.fxml,javafx.web -jar %APP_NAME%
pause

And I solved the problem.
 
Upvote 0
Top