Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Picked up _JAVA_OPTIONS: -Xmx256M

Tags:

java

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]
like image 358
mishra88 Avatar asked May 01 '17 06:05

mishra88


People also ask

What is picked up _JAVA_OPTIONS?

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.

What is _JAVA_OPTIONS in environment variable?

You can use _JAVA_OPTIONS to pass options to any JVM process started on your system. For example, set _JAVA_OPTIONS=-Dsun.java2d.noddraw=true. When a JVM starts, it parses the value of _JAVA_OPTIONS as if the parameters were at the command line of java. You can see the passed parameters via JVisualVM.

Can I delete _JAVA_OPTIONS?

If you have a variable in Windows Environment Variables called _JAVA_OPTIONS, just delete it and it should fix the issue.

Where is _JAVA_OPTIONS in Linux?

conf. /etc/environment.


1 Answers

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.

like image 192
Peter Rogers Avatar answered Sep 26 '22 14:09

Peter Rogers