Mac OS X IntelliJ idea, JEdit, and other Java programs Chinese punctuation is the perfect solution to the invalid _java

Source: Internet
Author: User

Mac OS X Java based programs (such as IntelliJ idea, jEdit, etc.) will appear in the Chinese punctuation input invalid problem, in the Chinese input method state, you can enter the text, but the last to enter Chinese punctuation is the English punctuation. Check the relevant information, the original Java is its own bug. This bug has been seen since the Java 8u51 version, and until now the latest Java 8u72 is still the case, but the old version of Java 8u45 has no such problem. So, you can take the alternative approach to the old version of the JDK 8u45 on Mac OS X, which does not affect the new version of the JDK that is already installed. Then, make a small change to the java-based program, as follows:

1, for IntelliJ idea, Appcode, webstorm modification

Take idea as an example, enter the/applications/intellij idea.app/contents/jre directory, and execute the following command:

$ mv JDK jdk.backup
$ ln-s/library/java/javavirtualmachines/jdk1.8.0_45.jdk JDK

Restart idea, you can enter Chinese punctuation is normal. Appcode, webstorm changes are the same.

2, for jEdit modification, there are two ways

(1) Method one:

Download a generic startup script for Java based programs in Mac OS X Environment, the official address is https://github.com/tofi86/universalJavaApplicationStub, this script can be changed by you freely Java The details of the program startup and the ability to support MAC OS X program wrapper profiles, such as Info.plist, and so on. Copy the script universaljavaapplicationstub to the/applications/jedit.app/contents/macos directory, and then go to the directory and execute the following command:

$ mv jedit jedit.backup
$ mv universaljavaapplicationstub jedit
$ VI jedit

Define the internal environment variable java_home=/library/java/javavirtualmachines/jdk1.8.0_45.jdk/contents/home inside the script to find the command code that really starts JAVA. Set the internal environment variable Jvmclasspath=${oraclejavafolder}/jedit.jar, save and exit, restart JEdit.

(2) Method two:

Execute the following command:

$ cd/applications/jedit.app/contents
$ mkdir Plugins
$ ln-s/library/java/javavirtualmachines/jdk1.8.0_45. JDK Jdk8

Modify the Info.plist file to add the following key-value pairs:

<key>JVMRuntime</key> 
<string>jdk8</string>

Exit after saving, restart JEdit.

The above is a small set to introduce the Mac OS X under IntelliJ idea, JEdit Java program, such as the perfect solution for Chinese punctuation, hope to help everyone, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!

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.