Java-based programs (such as IntelliJ IDEA, jEdit, etc.) under Mac OS X will have the problem of invalid input of Chinese punctuation. In the Chinese input method state, you can enter Chinese characters, but the English punctuation that enters the Chinese punctuation last is the English punctuation. After checking the relevant information, it turned out that this was a bug of Java. This bug has occurred since the Java 8u51 version, and it is still the case with the latest Java 8u72, but the old version of Java 8u45 does not have this problem. Therefore, you can take a workaround to install an old version of JDK 8u45 on Mac OS X at the same time, which will not affect the new version of JDK that has been installed. Then, small modifications are made to Java-based programs, as follows:
1. Modifications for IntelliJ IDEA, AppCode, WebStorm
Taking 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
Just restart IDEA, and it will be normal to enter the Chinese punctuation. The same applies to the modification of AppCode and WebStorm.
2. There are two ways to modify jEdit
(1) Method 1:
Download a general startup script for Java-based programs in Mac OS X environment. The official address is https://github.com/tofi86/universalJavaApplicationStub. This script can be freely modified by you to modify the details of Java program startup and can support Mac OS X program packaging configuration files, such as Info.plist, etc. Copy this script universalJavaApplicationStub to the /Applications/jEdit.app/Contents/MacOS directory, then enter this 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 in it, find the command code that actually starts java after the script, set the internal environment variable JVMClassPath=${OracleJavaFolder}/jedit.jar, save it and exit, and restart jEdit.
(2) Method 2:
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 and add the following key-value pairs:
<key>JVMRuntime</key> <string>jdk8</string>
Save and exit, and restart jEdit.
The above is the perfect solution for invalid Chinese punctuation input of Java programs such as IntelliJ IDEA and jEdit under Mac OS X that the editor introduced to you. I hope it will be helpful to you. If you have any questions, please leave me a message and the editor will reply you in time. Thank you very much for your support to Wulin.com website!