B4J Question Solved: Raspberry deployment

udg

Expert
Licensed User
Longtime User
Hi all,

I had a working B4J non-UI webserver-like app on my dev PC. Today I copied the jar file to its own dir on Raspy along with the www directory containing HTML&CSS files needed by the app.
When I launch the jar with command:
java -jar testapp.jar
it results in
Exception in thread "main" java.lang.NoClassDefFoundError: anywheresoftware/b4a/ BA
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2521)
at java.lang.Class.getMethod0(Class.java:2764)
at java.lang.Class.getMethod(Class.java:1653)
at sun.launcher.LauncherHelper.getMainMethod(LauncherHelper.java:494)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:486)
Caused by: java.lang.ClassNotFoundException: anywheresoftware.b4a.BA
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
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)

What could be the cause? TIA.

Java: 1.7.0_40
B4J: 2.20
jCore: 1.81

udg
 
Last edited:

udg

Expert
Licensed User
Longtime User
Ok, it was some time since I lastly used B4J and so I did forget about the #MergeLibraries setting.
To solve my issue, I just set it to True and copied the jar from a new compile to Raspy.
That was it.
 
Upvote 0
Top