I took the sage advice of several of the responders to this question and
installed the Oracle version of Java 18.0.1.1 into my home directory. I
did not have success with placing a modified netbeans.conf in the
netbeans/etc file located in the snap directory in my home directory.
To get netbeans to use the newly installed JDK when invoked from the KDE
menu, I edited the netbeans_netbeans.desktop file in
/var/lib/snapd/desktop/application to add the --jdkhome parm as shown below.
Thanks to everyone who responded to this issue. I guess I will have to
educate myself on snap.
[Desktop Entry]
X-SnapInstanceName=netbeans
Type=Application
Name=Apache NetBeans 13
Comment=Apache NetBeans, The Smarter Way to Code
Exec=env
BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/netbeans_netbeans.desktop
/snap/bin/netbeans %F *--jdkhome jdk-18.0.1.1*
Categories=Development;IDE
Icon=/snap/netbeans/58/meta/gui/icon.png
Terminal=false
StartupWMClass=Apache NetBeans IDE 13