Each time i execute java code i get this message:Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true
This problem has solution for windows os but i can't find any solution for linux os.
I found a solution to this problem, I lost a lot of time of course. I'm definitely not sure what creates this situation, in my case it happened after installing NetBeans and changing the text display settings, I turned on anti-aliasin.
These settings are defined in these configuration files, just remove them:
/etc/X11/Xsession.d/90kali-themes.conf
/etc/environment.d/95kali-themes.conf
Java Option disabling in terminal
if your using java11-jdk in linux this might be working for disabling the java option from displaying in terminal.
_SILENT_JAVA_OPTIONS="$_JAVA_OPTIONS" && unset _JAVA_OPTIONS && alias java='java "$_SILENT_JAVA_OPTIONS"'
This is not warning, it is information.
It literally says that some settings were picked up from _JAVA_OPTIONS environmental variable. It is used to configure some switches "globally" for every java application that will be run in given environment. You must have this set either on system or user level. If you remove that variable, information will be gone.
ON Kali Linux ANDROID STUDIO
This information comes because an environment variable called _JAVA_OPTIONS setup by default. I solved it by Unseating the variable.
**To unset the value of this variable, use unset _JAVA_OPTIONS.
After that Android Studio will no longer display the information and Android Studio will be able to build projects that were previously failing to build..
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 have recently replaced Java 7 to Java 8.
All regular apps in IntelliJ runs smoothly.
All but the tomcat apps - which run from the cmd command line but not from IntelliJ.
It fails to load due to an error in the JRE_HOME definition.
I have oviously defined JRE_HOME in the env variables and in the jdk settings.
I have executed
echo %jre_home%
both in the IntelliJ terminal and in the cmd and received different values
(IntelliJ terminal showed unupdated value.).
Where are the variables in the terminal declared?
How do I change them?
I don't know about old IntelliJ versions, but in 2019.2.3 one can configure environment variables in project settings. Be aware, you need to restart existing terminal or create new terminal tab to see the effect.
Almost 5 years later, I have the same issue on Windows 10 and had to restart my computer to solve it.
Edit:
The best solution is to not define a JRE_HOME environment variable. I don’t know why but IntelliJ stucks using that env variable.
If you are launching IntelliJ via the JetBrains ToolBox it will cache the $PATH variable so recent changes will not appear.
Just close and re-open JetBrains Toolbox.
For me it was because IntelliJ IDEA did not launch the shell as a "login" shell. All of my environment variables are set as I expect in a login shell, but in a non-login shell, many of them are missing.
By way of example, I expect /usr/local/bin to be in my PATH, but that is only true within login shells (as I get when I run iTerm2). This is an excerpt from a terminal session within IntelliJ IDEA:
amacleod#valjean ~> echo $PATH | grep -c /usr/local/bin
0
(1) amacleod#valjean ~> $SHELL --login
Welcome to fish, the friendly interactive shell
amacleod#valjean ~> echo $PATH | grep -c /usr/local/bin
1
One possible workaround would be to add my expected PATH and other variables to the shell configuration for non-login shells, but I would really rather just always be in a login shell.
I would have hoped that IntelliJ IDEA would have a checkbox for sending --login in the Terminal settings. However, it is possible to override the Shell path setting to include the login flag.
Invalidating the systems cache should do the trick. see JetBrains: Invalidate Cache.
Any other measures (like closing projects and IDE seemed to work only on a per project basis and only after a while (when IDE detected that the cache is invalid by itself ...)
Edit:
Correction - Unfortunately, after having the corrected the environment in all terminals for a while, IntelliJ "reverted" to the old, incorrect environment in any of my projects. Now I hope that after a reboot - as posted by akuman8 - the issue is solved. (If not, I will stick to a commandshell of my choice outside the IDE, where everything works fine ...)
For me, invalidating the system cache or restarting IntelliJ didn't reload the updated environment variables.
After restarting the computer, it enabled IntelliJ to pick up the updated environment variables.
AFAIKT, the intellij terminal on linux is just the same as running a standalone terminal session. It's just conveniently located in the IDE.
In response to the question, "How do I change [the terminal environment variables]?"
I'm using virtualenvwrapper to manage my terminal's environment variables for different environments, such as dev, test and production. It's working just as well for java development as it was for python development.
https://virtualenvwrapper.readthedocs.org
Close all IntellJ windows and any process that may currently be using the wrong SDK.
Navigate to the folder where your JDK is installed (e.g. C:\Program Files\Java).
Rename the wrong SDK so something else (e.g. jdk-11.0.5.OLD). If it won't do this, you may still have a process running using that SDK; go back to 1.
Start IntelliJ again.
It seems you can define project specific environment variables:
In IntelliJ project specific environment variables you can set under
Run/Debug configurations --> Defaults --> Application --> Environment
variables
from:
http://emmanuelbernard.com/blog/2012/05/09/setting-global-variables-intellij/#comment-617922540
I'm working on setting up my development environment in Windows 7, installing Maven, etc. I've been running into path issues and have read, ad nauseum, other posts that pointed me in the right direction. My problem is, however, that my PATH variable (JAVA_HOME) isn't staying set.
When I try
mvn --version
I get
Error: JAVA_HOME not found in your environment.
Please set the JAVA_HOME variable in your environment to match the location
of your Java installation.
So, I set it
set JAVA_HOME=C:\Tools\Java
and then mvn --version works. But if I close and then reopen the Windows terminal I just end up getting the original error. Super frustrating.
I've also added that path to the Environmental Variables in the Systems Settings (with the semi-colon spacing, etc) Path section.
You're only setting it within that shell. This is perfectly normal behaviour for environment variables - not just on Windows, but on other OSes too.
I don't know about Windows 7, but on Windows 8 if I press the Windows key and start typing "Environment Variables" I get an option to open the control panel applet for editing the user or system environment variables. That's where you want to put it. The right dialog looks like this:
If the method above doesn't get to it, you can use the System Properties dialog, which has a button near the bottom for it:
This is how the shell works in Windows, Mac OSX and UNIX and I suspect all operating systems.
Each prompt has it's own environment which is separate to any other process you have running. You can set a variable temporarily, but this is not saved to disk or preserved because you might set it in a script but you don't want it to affect the whole system.
If you want to change an environment variable in Windows you need to do Start -> Right Click Computer -> Properties -> Advanced Setting -> Environment Variables -> Add Property.
On Linux, you add your SET line to the ~/.bashrc file
To set environment variables in Windows, go to the System control panel (the quickest way is to right click Computer in the Start Menu and select Properties), and select Advanced system settings, and then Environment Variables...
Go to System ->Advanced System Setting ->Environment Variables. In System Variables, Click on New and provide the Following:
Variable name as : JAVA_HOME
Variable Value as :E:/JdkInstallions/Jdk1.7 (as on my system)
This should resolve the problem you are getting.
I'm on Windows 7 and I'm trying to set my JAVA_HOME path to use PhoneGap on android, when i create a project using the command line "cmd" it tells me that it can't find javac.exe? although i'm sure that I've set the variable right
here's my stuff:
Variable name: JAVA_HOME
Variable value: C:\Progra~1\Java\jdk1.7.0_17\bin
(I've also tried to use: C:\Progra~1\Java\jdk1.7.0_17\bin\javac.exe)
My javac.exe location on my laptop C:\Program Files\Java\jdk1.7.0_17\bin\javac.exe
and it still tells me that it can't locate the javac.exe
What I type to create the project and i meet this problem is this:
C:\Users\user>cd C:\Users\user\Desktop\phonegap-2.8.1\lib\android\bin
C:\Users\user\Desktop\phonegap-2.8.1\lib\android\bin>create.bat
Cannot locate javac.exe using the PATH environment variable.
Retry after adding directory containing javac.exe to the PATH variable.
Remember to open a new command window after updating the PATH variable.
Visit http://java.oracle.com if you need to install Java (JDK).
Also, i've tries restarting the windows and closing the command prompt and redownloading the JDK.
Thank You.
cmd is using the values from the PATH variable to locate javac :
set "PATH=%PATH%;C:\Program Files\Java\jdk1.7.0_17\bin"
For other softwares (Tomcat, Maven, etc.) JAVA_HOME must indicate the root of your JDK :
set "JAVA_HOME=C:\Program Files\Java\jdk1.7.0_17\"
No need to restart Windows. When using set the changes are taken immediately.
If you choose to modify those variables in the Control Panel, you have to close and relaunch cmd for the changes to take effect.
You have to add java
C:\Program Files\Java\jdk1.7.0_17\bin
Note that your path may be different.
to your environment variables and restart your console.
You can find how to set your variables here:
http://www.itechtalk.com/thread3595.html
Set the JAVA_HOME Variable
Right-click the My Computer icon on your desktop and select Properties.
Click the Advanced system settings. Click the
Environment Variables button. Under System Variables, click New.
Enter the variable name as JAVA_HOME.
Enter the variable value as the installation path for the Java Development Kit(C:\Program Files\Java\jdk1.7.0_17).
Click OK.
Click Apply Changes.
You might need to restart windows.
Set the JAVA_HOME environmental variable to
C:\Program Files\Java\jdk1.7.0_17
Press
Win + Break > Advanced System Settings > Environment Variables > System Variables
Modify/set JAVA_HOME to the above. (No need to restart)
I already had this error when I tried to create a new phonegap project for android but unfortunately I don't remember how exactly I have fixed this.
I don't know if you have followed the phonegap documentation so here is the link : new project, especially the part 3B (be careful about ; in your PATH).
If you don't know what to do now, maybe you should do it again step by step.
May be a little old, but since this is the first goolge result, I might as well add a little something.
You need to create the JAVA_HOME variable AND edit the PATH variable, adding ;%JAVA_HOME%\bin (with a ;) so cmd and some other apps can actually use javac and the rest of the tools
I'm currently developing in 3 different Java versions and therefore often change my JAVA_HOME variable. However, I have to log out in order to get the variable updated. I update it via System Properties -> Advanced -> Environment Variables (Windows XP).
Surely there is a smarter/easier way of doing this.
I guess I could use the SET command in prompt, but that is not permanent and as I often use one Java version for a period of time I don't want to reset it every time I start the PC.
Any suggestions?
You don't have to log out to get an environment variable to stick, but you do have to restart whatever processes you're interested in. So for example, if you're using the command prompt, you will need to kill the command prompt and start a new one.
You could create 3 .bat files, each setting the JAVA_HOME variable and then starting your Development Environment.
I typically have separate entries in the environmental variables for separate JDKs or JREs:
JDK141
JDK156
JDK1624
And when needed change the JAVA_HOME variable to refer to one of those:
JAVA_HOME = %JDK156%
Add that to what Jon and Tim suggested and you get a very flexible way to switch versions.
Also remember that you can do
c:/program files/java/jdk156/bin/java.exe YourFolder/YourClass
As long as what you use isn't referring directly to JAVA_HOME you can force the use of a specific JRE/JDK if you specify the path in your command.
Cheers,
Wim
Have the latest version of the SDK installed (7 at this time), then use the Cross-compilation options of javac when compiling.
to change the Java home without restarting or re-logging:
Open Command prompt and type
"set JAVA_HOME=C:\Program Files (x86)\Java\your jdk folder" then press enter.
This will change the current environment settings until you restart or re-log to your windows account then it will read the settings from the windows environment settings.
If you want the new settings to be permanent go to System Properties -> Advanced -> Environment Variables and change the JAVA_HOME settings
I hope this helps