How to solve the kernel wing problem in linux

Source: Internet
Author: User
Solution to the kernel wing problem in linux-general Linux technology-Linux programming and kernel information. For details, refer to the following section. Friends who develop java in linux know that swing has some headaches in linux.

The first problem is that the conflicts between the scim input method and swing cause the keyboard to fail, especially after compiz is enabled.

There are many ways to solve this problem online, such as adding the environment variable AWT_TOOLKIT = MToolkit. This method still cannot solve the problem of keyboard failure in swing programs.

A good solution is:

Sudo cp ~ /. Scim/config/root/. scim/

Afterwards, I have never experienced a keyboard failure problem in netbeans.

The second problem is that SystemLookAndFeel cannot be used when Ubuntu uses Java to write Swing applications.

For example, when running jconsole, the following error is reported:

Exception in thread "AWT-EventQueue-0" java. lang. NullPointerException
At com. sun. java. swing. plaf. gtk. GTKLookAndFeel. initSystemColorDefaults (GTKLookAndFeel. java: 1267)
At com. sun. java. swing. plaf. gtk. GTKLookAndFeel. loadStyles (GTKLookAndFeel. java: 1509)
......

Some people provide an imperfect solution, that is, to change the language environment to English:

Export LANG = en

In this way, the swing application can run normally, but it is inconvenient for Chinese users and the interface becomes English. In fact, this problem occurs because swing uses systemlaf by default, but this laf is not defined in ubuntu.

A good solution is to pass the JVM runtime parameter-Dswing. systemlaf = javax. swing. plaf. metal. MetalLookAndFeel when the program starts.

Or add the/etc/environment file at the end:

_ JAVA_OPTIONS = "-Dswing. systemlaf = javax. swing. plaf. metal. MetalLookAndFeel"
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.