Mac OS X IntelliJ IDEA jEdit Java program Chinese punctuation input invalid perfect solution

  • 2020-05-12 02:33:04
  • OfStack

Under Mac OS X, the program based on Java (such as IntelliJ IDEA, jEdit, etc.) will have the problem of invalid Chinese punctuation input. In the state of Chinese input method, Chinese characters can be input, but the last Chinese punctuation input is English punctuation. I checked relevant materials, and it turned out to be Java's own bug. This bug, 1 has been around since Java 8u51, and is still present in the latest Java 8u72, but the old Java 8u45 does not have this problem. Therefore, a workaround method can be adopted to install an old version of JDK 8u45 on Mac OS X at the same time, without affecting the new version of JDK already installed. Then, the program based on Java is modified as follows:

1. Modification of IntelliJ IDEA, AppCode and WebStorm

IDEA, for example, entry/Applications/IntelliJ IDEA. app Contents/jre directory, execute the following command:


$ mv jdk jdk.backup
$ ln -s /Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk jdk

Just restart IDEA and enter Chinese punctuation. The modification of AppCode and WebStorm is the same.

2. There are two ways to modify jEdit

(1) method 1:

Download 1 for Mac OS X environment based on Java universal application startup scripts, the official address is https: / / github com/tofi86 / universalJavaApplicationStub, the script can be activated by you free modify Java program details, and the ability to support Mac OS X program packaging configuration files, such as Info. plist and so on. Copies this script universalJavaApplicationStub to/Applications/jEdit app Contents/MacOS directory, and then into the directory, execute the following command:


$ mv jedit jedit.backup
$ mv universalJavaApplicationStub jedit
$ vi jedit

In internal environment variables JAVA_HOME = / Library/Java/JavaVirtualMachines/jdk1. 8.0 _45. jdk/Contents/Home, behind the script to find real start java front command code, set up internal environment variable JVMClassPath = ${OracleJavaFolder} / jedit jar, saved quit, restart the jEdit can.

(2) method 2:

Execute the following commands:


$ 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>

After saving, exit and restart jEdit.


Related articles: