Whenever I execute java code on intellij on kali, or type java --version in command line
I get this message
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true.
I googled it and found this link that is exactly the same situation as me,
but what I understand is that it's an information not error and I can unset _JAVA_OPTIONS environmental variable.
What I'm asking for is that deleting this environmental variable will not cause any harm?
I read in the above link that If you remove that variable, information will be gone.
I didn't understand is that mean any damage or he just said that the message will gone!
And finally how to delete or unset this _JAVA_OPTIONS variable?
Update :
When I unset this variable by these commands
_SILENT_JAVA_OPTIONS="$_JAVA_OPTIONS"
unset _JAVA_OPTIONS
alias java='java "$_SILENT_JAVA_OPTIONS"'
-referenced from this link, the second answer- the message is still appear but after the output of the java program instead of before the output as it was!
Related
While running every program i am getting this message Picked up _JAVA_OPTIONS: -Xmx256M on console in eclipse without output.
I already tried related answers but none of them working in my case and I am not using _JAVA_OPTIONS variable in environment variable.
runtime error:
Picked up _JAVA_OPTIONS: -Xmx256M
ERROR: JDWP Unable to get JNI 1.2 environment, jvm->GetEnv() return code = -2
JDWP exit error AGENT_ERROR_NO_JNI_ENV(183): [util.c:840]
The message "Picked up _JAVA_OPTIONS" implies that the Java runtime has found this setting in your environment variables. The solution depends on which operating system you are running. But assuming it is Windows, there are two possibilities:
The most likely is that it is picking it up from the System or User environment. Try opening and command prompt and typing
echo %_JAVA_OPTIONS%
If you see "-Xmx256M", then that's where it is coming from. Hit the start button and search for "Edit the system environment" variables. On the "Advanced" tab, click the "Environment Variables..." button at the bottom. You'll find the _JAVA_OPTIONS variable in either the System variables or the User variables (or both!). Delete or change to suit.
The other possiblity is that your Java programs are being executed via a script. Look at the shortcuts' properties (or however you start the programs) to see if they are directly referencing a java ".exe" executable, or if they are using a script. Alternatively, in your command prompt type
where java
And check to see if this is a true .exe file or a script. It's possible that the _JAVA_OPTIONS variable is hidden in there.
If Using Ubuntu 16.04,
Check etc/profile there you may find _JAVA_OPTIONS: -Xmx256M set.
That's a file where environment variables are set for the whole. I assume you are facing this message for every java application you run. Although there are other ways to set environment variables.
This link ubuntu-environmentvariables describes them, you can check them and try to see where have you set this environment variable. It will exactly of this sort Picked up _JAVA_OPTIONS: -Xmx256M.
Hope it helps. I faced the same issue and detected in the profile document mentioned above.
Go to System Environment Variables
check for JAVA_OPTIONS under variables
delete or update based on your requirement
i got the value as 1024 i modified to 16384
-Xms1024m -Xmx16384m
I've run into a problem while trying to get the Java Debugger extension in VS Code to work. When I run it, an error is thrown that says:
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=gasp
From what I can see this error causes the debugger to stop before execution of the program. I unset _JAVA_OPTIONS in .bashrc but that did not fix it.
Any ideas as to what the problem is and possible resolutions to it?
EDIT: I changed development platforms before seeing ZhangTe's answer, but since it solved the problem for another user I'm marking it as accepted.
You can try to add the following to /etc/profile
unset _JAVA_OPTIONS
Then, reboot your computer or reload the profile file.
I have to use d3web. The tutorial gives me the following hint regarding the installation of d3web
So, I set the values of these variables like displayed in the picture.
But when starting the starting the startup.bat I receive a message stating that I have not set the values of JRE_HOME nor JAVA_HOME.
Do you know what went wrong?
I followed this thread to solve my problem, I have the same problem with a different version of JDK and for some reason it didn't work. I still get -bash: JAVA_HOME: command not found when I type JAVA_HOME to my terminal.
I have JDK1.8.0.45 located at Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home which I can access with /usr/libexec/java_home
Using
echo "export JAVA_HOME=/usr/libexec/java_home" >> ~/.profile
~/.profile
I do get
"export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home"
saved to ~/.profile, and I can check this using /usr/bin/open ~/.profile
But I do not understand why JAVA_HOME still doesn't work and I need this to install maven.
Thanks!
My ~/.bash_profile has this line in it, and it's been working fine.
export JAVA_HOME=$(/usr/libexec/java_home)
This line basically says "run the program named /usr/libexec/java_home and export its output as a variable named JAVA_HOME."
I suggest opening your .profile or .bash_profile in a text editor rather than using echo statements to append new lines to it. That way you can see everything that's in the file and make sure other old lines in the file aren't causing you issues.
After you make a change to .bash_profile, make sure you open a new terminal window before testing it.
You can check the value of any environment variable (including JAVA_HOME) by simply echo'ing its value:
echo $JAVA_HOME
In my case the output of that echo command is:
/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home
Probably you misunderstood things. JAVA_HOME is not a command, it's an environment variable. You can't call JAVA_HOME in your terminal since - in fact - there is no such command, what your error message says.
You can see this variable's value by:
echo $JAVA_HOME
If it is set and points to a proper location then it's fine. Some tools that expect this variable to be set (e.g. Maven or Java IDEs) will work well.
I am installing ant on a Windows XP machine, and am following the instructions at Apache's manual site. It said to set JAVA_HOME, so I checked, saw there was no environment variable named JAVA_HOME, made one, and set it to "C:\Program Files\Java\jdk1.6.0_19"
When I try to run ant debug, however, it tells me that JAVA_HOME is currently set to "C:\Program Files\Java\jre6"
I'm guessing JAVA_HOME isn't an environment variable. But if it isn't one, I'm at a loss as to where to start looking for it. Anybody know?
Edit: Oh yeah - it's bugging me for tools.jar as well, but I'm guessing that when I fix the JAVA_HOME issue, that will help the terminal find tools.jar as well. Or maybe I'm wrong. Thanks
Following on Newtopian's suggestions, you can quickly confirm if that behavior is the problem by running in the terminal
C:\>set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_19
C:\>ant debug
Also, I'm not sure if the text you entered into the JAVA_HOME environment variable is literally "C:\Program Files\Java\jdk1.6.0_19", i.e., with quotes, but if so, you should remove the quote marks as they'll throw off ant.bat.
Here's the relevant bit from ant.bat
:checkJava
set _JAVACMD=%JAVACMD%
if "%JAVA_HOME%" == "" goto noJavaHome
if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
if "%_JAVACMD%" == "" set _JAVACMD=%JAVA_HOME%\bin\java.exe
goto checkJikes
:noJavaHome
if "%_JAVACMD%" == "" set _JAVACMD=java.exe
... omitted ...
"%_JAVACMD%" %ANT_OPTS% -classpath "%ANT_HOME%\lib\ant-launcher.jar" "-Dant.home=%ANT_HOME%" org.apache.tools.ant.launch.Launcher %ANT_ARGS% %ANT_CMD_LINE_ARGS%
If that doesn't help, could you post your debug task?
Two options to make it permanent:
Run this:
C:\>REG delete HKCU\Environment /V JAVA_HOME
C:\>REG delete HKLM\Environment /V JAVA_HOME
C:\>REG add HKCU\Environment /V JAVA_HOME /d "C:\Program Files\Java\jdk1.6.0_19"
(basically, ensure you only have one JAVA_HOME set and it's correct; be sure to close and reopen the terminal after doing this)
If all else fails, the crappy batch file solution:
#echo off
set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_19
ant %*
save as ant_wrapper.bat (or whatever) and you should be able to do ant_wrapper debug.
(Both of these solutions are untested)
Make sure you check both user and system scope environment Variables. I am not certain what is the precedence of one over the other here but most likely you checked as only one and created it there and it is being overridden by the other.
Also when you create the environment variable make sure you open a new command shell for the changes to take effect. then try 'set' that will list all environment variables seen in the environment for the command prompt you just created.
If all is well there but Ant still does not see the correct one then check the batch files that start ANT if the javahome is not set there too. If it is make sure it uses the environment variable and does not try and set it again.
Hope this helps