B4J Question I'm trying to make changes to a major old project with latest version B4j and Java!

johnerikson

Active Member
Licensed User
Longtime User
I'm trying to make changes to a major old project with latest version B4j and Java!
Receive the following error message:
Using Windows 10 Pro

_____________________________________________________________________

If I use Java 11, it can not compile the entire project in debug or release mode!
Get the following error:

B4J Version: 8.50
Java Version: 11
Parsing code. (0.32s)
Building folders structure. (0.10s)
Compiling code. (0.65s)
Compiling layouts code. (0.00s)
Organizing libraries. (0.00s)
Compiling generated Java code. Error
B4J line: 1053
cvs.DrawBitmapRotated(bmp, cvs.TargetRect, Degr
src\GISIQON\EasyMedia\webutils.java:1231: error: package javafx.scene.image does not exist
_cvs.DrawBitmapRotated((javafx.scene.image.Image)(_bmp.getObject()),_cvs.getTargetRect(),_degrees);

____________________________________________________________________



If I use Java 8 I can't compile the project in Debug mode!
Receives the following message:

Waiting for debugger to connect...
java.lang.ExceptionInInitializerError
Caused by: java.lang.RuntimeException: java.net.SocketException: Connection reset
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:120)
at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:98)
at GISIQON.EasyMedia.main.<clinit>(main.java:17)
Caused by: java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:210)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
at java.io.BufferedInputStream.read(BufferedInputStream.java:265)
at java.io.DataInputStream.readByte(DataInputStream.java:265)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:229)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:91)
... 2 more
Exception in thread "main"


__________________________________________________________________________

If I use Java 8, I can compile the project in Release mode!

And the project work satisfactorily

Receives the following message:

B4J Version: 8.50
Java Version: 8
Parsing code. (0.27s)
Building folders structure. (0.03s)
Compiling code. (0.48s)
Compiling layouts code. (0.00s)
Organizing libraries. (0.00s)
Compiling generated Java code. (2.11s)
Building jar file. (2.84s)
Jar file created: C:\D\program\B4j\Server\ABMServer\EasyMedia\Objects\EasyMediaStart.jar
Run application. (0.01s)
Compiled Successfully

_________________________________________________________________________________

Other things that happen frequently that cause the restart of the operating system!

B4J Version: 8.50
Java Version: 11
Parsing code. (0.27s)
Building folders structure. Error
The process cannot access the file C:\D\program\B4j\Server\ABMServer\EasyMedia\Objects\EasyMediaStart.because it is used in another process.
 

agraham

Expert
Licensed User
Longtime User
Where did your get your Java 11 from? You should download the one on the B4J product page as it includes JavaFX which looks like it is missing from yours.

The process cannot access the file C:\D\program\B4j\Server\ABMServer\EasyMedia\Objects\EasyMediaStart.because it is used in another process.
I assume that is the jar file. Normally it is because the process is still running, if it is not visible to be closed then you can kill it with Task Manager or just log out of Windows and log back in again which will kill all your processes. No need to reboot Windows.

I have no suggestions about the Java 8 Debiug problem.
 
Upvote 0

johnerikson

Active Member
Licensed User
Longtime User
Microsoft Office Translator
I have upgraded B4j to ver. 8.80 and checked under sub Class_Globals, no code other than declarations is there.

Howeveer it looks like something is missing in JavaFX in my installation of Java 11.01. See below


Compiling generated Java code. Error
B4J line: 1053
cvs.DrawBitmapRotated(bmp, cvs.TargetRect, Degree
src\GISIQON\EasyMedia\webutils.java:2142: error: package javafx.scene.image does not exist
_cvs.DrawBitmapRotated((javafx.scene.image.Image)(_bmp.getObject()),_cvs.getTargetRect(),_degrees);


4J line: 58
Dim mlbl As B4XView = Lbl
src\GISIQON\EasyMedia\anotherdatepicker.java:738: error: cannot access Label
_mlbl = (anywheresoftware.b4a.objects.B4XViewWrapper) anywheresoftware.b4a.AbsObjectWrapper.ConvertToWrapper(new anywheresoftware.b4a.objects.B4XViewWrapper(), (java.lang.Object)(_lbl.getObject()));
^
class file for javafx.scene.control.Label not found
 
Upvote 0

johnerikson

Active Member
Licensed User
Longtime User
I have downloaded all the tools re-installed according to instructions (hope I understand them). I use 7-Zip to unpack zip files.
Doesn't help! I have a module AnotherDataPicker (from this forum) as if I comments code completely then succeed the compilation but the program can not start either in debug or release mode. It always points to the same problem.

I debug mode
Waiting for debugger to connect...
java.lang.NoClassDefFoundError: javafx/scene/Node
. more text
.
Caused by: java.lang.ClassNotFoundException: javafx.scene.Node
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)


I Release mode
webutils._process_globals (java line: 815)
java.lang.NoClassDefFoundError: javafx/scene/Node
at GISIQON. EasyMedia.webutils._process_globals(webutils.java:815)
at GISIQON. EasyMedia.main.initializeProcessGlobals(main.java:230)
at GISIQON. EasyMedia.main.main(main.java:27)
Caused by: java.lang.ClassNotFoundException: javafx.scene.Node
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 3 more


But if I use Java 8 then all works. So I choose to go back to Java 8 with this project, it's very easy to change java version. I use ver. Java 11 for small applications for distribution to other computers without Java installed!

Another problem is that IDE version 8.80 crashes frequently, mostly when marking text. You have to finish the program to continue!
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
I debug mode
Waiting for debugger to connect...
java.lang.NoClassDefFoundError: javafx/scene/Node
. more text
You haven't configured Java correctly. Carefully follow the installation instructions and don't forget to update the path under Tools - Configure Paths.

Another problem is that IDE version 8.80 crashes frequently, mostly when marking text.
I'm not familiar with such problem. It was never reported before. Please start a new thread and provide more information.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…