B4R Tutorial [tool] External Serial Connector

rwblinn

Well-Known Member
Licensed User
When running under JDK9, Windows 10, B4J v5.9, after opening a COM port, the application crashes with error below.
Googled around and found this thread. Downloaded the mentioned updated jSCC.jar, copied to the additional B4J libraries ... but did not solve the issue.

Has anyone else experienced same issue under JDK9? Any workarounds?

BTW: Verified opening the COM port using the Arduino, is working fine.

B4X:
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000007110b5db, pid=11220, tid=10872
#
# JRE version: Java(TM) SE Runtime Environment (9.0+181) (build 9+181)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (9+181, mixed mode, tiered, compressed oops, g1 gc, windows-amd64)
# Problematic frame:
# C  [jSSC-2.8_x86_64.dll+0xb5db]
#
# No core dump will be written. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# C:\Daten\b4\ztools\B4RSER~1\Objects\hs_err_pid11220.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
 

rwblinn

Well-Known Member
Licensed User
Thanks - indeed having multiple JDK versions installed and went back to JDK8.

Wondering if there are any advantages in using JDK9 vs JDK8 for B4J application development - but thats a different question...
 

raphaelcno

Active Member
Licensed User
In the AppStart Sub, there is one line "Wait For (GetPortsNames)" and one line "GetPortsNames".
Does it mean that the GetPortsNames Sub is run twice?

B4X:
Sub AppStart (Form1 As Form, Args() As String)
    MainForm = Form1
    MainForm.RootPane.LoadLayout("1")
    MainForm.Show
    DataFolder = File.DirData("SerialConnector")
    serial.Initialize("")
    Wait For (GetPortsNames) Complete (unused As Boolean)
    cmbPort.Items.AddAll(PortsNames.Values)
    If File.Exists(File.DirApp, settingsFile) Then
        Dim m As Map = File.ReadMap(File.DirApp, settingsFile)
        If m.ContainsKey("port") Then
            Dim SavedPort As String = m.Get("port")
            If PortsNames.ContainsKey(SavedPort) Then
                cmbPort.SelectedIndex = cmbPort.Items.IndexOf(PortsNames.Get(SavedPort))
            End If
        End If
        chkReset.Checked = m.Get("reset")
    End If
    If cmbPort.SelectedIndex = -1 Then cmbPort.SelectedIndex = cmbPort.Items.Size - 1
    udpListener.Initialize2("udp", 51042, 8192, True, True)
    GetPortsNames
End Sub
 
Top