[Java] deepin solves the problem of picked up in JDK_JAVA_Options:-AWT. Usesystemaafontsettings=gasp

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: