The following one works though:
netbeans --jdkhome /snap/openjdk/current/jdk
Making that default the following would do:
cp -r /snap/netbeans/current/netbeans/etc $HOME/snap/netbeans/current/
echo 'netbeans_jdkhome="/snap/openjdk/current/jdk"' >>
$HOME/snap/netbeans/current/netbeans.conf
However that's not a tested situation. Here OpenJDK Snap package is
confined, runs in it's own security sandbox, while NetBeans does not
which could cause troubles especially when NetBeans needs to reach for
native libraries outside the one provided by the JDK.
On 5/24/22 10:47, Laszlo Kishalmi wrote:
Well,
However I like the idea of Snap packages (being the main maintainer of
the NetBeans one), I'd just install java from the standard Ubuntu
debian packages or if you need something exotic, using SDKMAN (search
on that if you are thinking about it). This could be as simple as:
sudo apt install -y openjdk-17-jdk openjdk-17-source
On 5/23/22 18:13, Stroud Custer wrote:
I just installed Netbeans and OpenJDK onto by Kubuntu 22.04 LTS. For
some reason the required aliases to map openjdk.java to java, etc.
were not created when OpenJDK was installed. I created the aliases
found in the file /var/snap/openjdk/common/openjdk.env. Typing
"java", "javac", "jar" into a command line now produces the expected
results. However when in attempt to invoke Netbeans, it complains
that it can't find java and that the --jdk-home option should be
used. I've tried several variations of this /snap/bin, etc. but I
still get the "can't find java" message.
Has anybody else encountered this problem, or know of any easy
installation that will get me jdk that netbeans recognizes?