Domestic deepin Linux operating system, in accordance with the manual JDK, as long as a run Java related commands will appear such a sentence
Picked up _ JAVA_ OPTIONS: -Dawt.useSystemAAFontSettings=gasp
e.g.
java -version
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=gasp
java version "1.8.0_05"
Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode)
In eclipse, MyEclipse and Android studio, when you run a program, there are also related statements, which make people angry. This problem has been bothering me for a long time
Today, we have finally found a solution:
for different operating systems, refer to the solution(Basically the same)
The main reasons are as follows
The original openjdk setting interferes with the manual installation of JDK. The interfering file is/etc/profile.d/java-awt-font-gasp.sh
The solution(1)
1、 Copy the relevant openjdk settings to JRE in your JDK
sudo CP – P/etc/java-7-openjdk/properties/opt/Java/jdk1.8.0_ 66/jre/lib/
If it’s just to solve the above problems, it can be avoided, but for the sake of insurance
2、 Back up files
sudo cp -p /etc/profile.d/java-awt-font-gasp.sh ~/.local/share/init.d-bak
3、 Delete file
sudo rm /etc/profile.d/java-awt-font-gasp.sh
4、 Log out or restart to solve the problem
Solutions(2)
Some time ago, I did the system again, but I still met the same problem, but I didn’t solve the problem according to the previous method. The new solutions are summarized
【1】 Find the/etc/profile file and add the following before the JDK environment variable:
unset _JAVA_OPTIONS
【2】 Log off the user and solve the problem
Principle:
I found that the main reason for this problem is that there is an environment variable named in the environment variable_ JAVA_ However, no matter how the terminal is deleted, the final result will only affect the current terminal. There are still problems when opening other terminals or software. But I didn’t find the data to add this in any environment variable file. I thought: can I disable this environment variable directly when the system is loading, so I added the above content to the/etc/profile file, and the problem was solved
Similar Posts:
- [Solved] Err:12 http://security.ubuntu.com/ubuntu focal-updates/main amd64 openjdk-11-jre-headless amd64 11.0.11+9-0ubuntu2~20.04 404 Not Found [IP: 91.189.88.152 80]
- JAVA Command Error: A JNI error has occurred, please check your installation and try again [Solved]
- gradle –version Error: ERROR: JAVA_HOME is set to an invalid directory: /usr/local/opt/openjdk
- [Solved] Mac install maven Error: zsh: command not found: MVN
- [Solved] NB: JAVA_HOME should point to a JDK not a JRE
- at sun.awt.FontConfiguration.getVersion(FontConfiguration.java:1264) [How to Solve]
- [Solved] JAVA Run Error: Error: Could not find or load main class
- Tomcat running under Linux reports an error broken pipe
- [Solved] JPype Error: FileNotFoundError: [Errno 2] No such file or directory: ‘/usr/lib/jvm’
- Error: JAVA_HOME is not set [How to Solve]