How can I fix picked up_java options?

368    Asked by Kaalappanshingh in Java , Asked on Oct 6, 2022

 This issue is on Manjaro Deepin 15.9 linux DE. When I run java -version in terminal it outputs this:

Picked up _JAVA_OPTIONS:    

java version "11.0.2" 2019-01-15 LTS     

Java(TM) SE Runtime Environment 18.9 (build 11.0.2+9-LTS)    

Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.2+9-LTS, mixed mode)

But if the command is run with sudo it outputs it normally without the Picked up _JAVA_OPTIONS: message !

I managed by placing unset JAVA_OPTIONS in /etc/environment , /etc/profile and ~.bashrc to remove the message from the terminal. But the message still shows up in Netbeans when I run a project.

Also I ran Netbeans as sudo just to check if it would show then and it didn’t. I tried removing some software from Linux which I didn’t need or believe was causing the message (because I read a few posts about software being an issue), but nothing changed.

Message not showing in sudo makes me believe maybe the root user doesn’t have something installed that the normal user has which is producing this message.

This message is visible in the live preview of Manjaro Deepin on bootable usb!


Answered by Kabir Singh

I know it's an old question, but in case anyone comes across this later...


TL;DR you can't suppress this message. See https://stackoverflow.com/a/13863175/4797233 for alternatives.

But why did it only appear sometimes? When you changed users with sudo it changed your environment as well, and apparently the picked up_JAVA OPTIONS variable did not exist in the root user's environment. It also vanished when you removed that variable from your own environment. However, Netbeans can adjust the environment however it wants before creating a Java subprocess, and it is configured to add in this variable whether it was there or not. You should be able to configure Netbeans not to add the variable at all, but the exact steps to do so will depend on your Netbeans version.



Your Answer

Interviews

Parent Categories