Pycharm install complains about OpenJDK

2020-05-19 02:15发布

I try to install Pycharm on Ubuntu 12.04 and I have this information:

user@user:~/Pobrane/pycharm-2.5.2/bin$ sh pycharm.sh
OpenJDK Runtime Environment (IcedTea6 1.11.1) (6b24-1.11.1-4ubuntu3)
OpenJDK Server VM (build 20.0-b12, mixed mode)
WARNING: You are launching the IDE using OpenJDK Java runtime.

         ITS KNOWN TO HAVE PERFORMANCE AND GRAPHICS ISSUES!
         SWITCH TO THE ORACLE(SUN) JDK BEFORE REPORTING PROBLEMS!

NOTE:    If you have both Oracle (Sun) JDK and OpenJDK installed
         please validate either PYCHARM_JDK, JDK_HOME, or JAVA_HOME environment variable points to valid Oracle (Sun) JDK installation.
         See http://ow.ly/6TuKQ for more info on switching default JDK.

Press Enter to continue.

What to do to work normally?

4条回答
时光不老,我们不散
2楼-- · 2020-05-19 02:46

Just to add to littlepea's answer, if you try to uninstall openjdk, then it will uninstall all the applications that depends on this package along with it i.e. XBMC. You can always install two JDK's and let the application choose which JDK it wants to use and vice versa. I have the two JDK's installed and don't have any problem in running either XBMC or PyCharm.

查看更多
虎瘦雄心在
3楼-- · 2020-05-19 02:53
  1. Check the architecture of your system:uname -m
  2. Download Oracle's JDK (7/8) from their website or use wget: mkdir -p ~/Downloads && cd ~/Downloads && wget --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u31-b13/jdk-8u31-linux-x64.tar.gz
  3. Once that's done, extract it to /opt/jdk (as root): mkdir -p /opt/jdk && tar -zxf ~username/Downloads/jdk-8u*-linux-x64.tar.gz -C /opt/jdk
  4. Download Pycharm and follow normal installation procedure.
  5. Edit /path/to/pycharm/install/bin/pycharm.sh. Immediately above the conditional block starting with if [ -n "$PYCHARM_JDK" -a -x "$PYCHARM_JDK/bin/java" ];, add a line stating export PYCHARM_JDK=/opt/jdk/jdk1.8.0_N; (where N is the version of the JDK that you have downloaded).
  6. Start Pycharm and Go to 'Help' -> 'About'. It should show 'JRE 1.8.0_*' instead of 'OpenJDK'.

Note: Don't run update-alternatives if you have installed software that uses OpenJDK. Switching versions might cause issues/crashes in those applications.

Source

查看更多
爷、活的狠高调
4楼-- · 2020-05-19 03:05

You need to swap OpenJDK to Sun JDK.

Run this in your terminal (Ctrl + Alt + T):

sudo apt-get purge openjdk*
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer

Follow the installation instructions and then check your Java version:

java -version

It should return something like this:

java version "1.7.0_10"
Java(TM) SE Runtime Environment (build 1.7.0_10-b18)
Java HotSpot(TM) 64-Bit Server VM (build 23.6-b04, mixed mode)

To automatically set up the Java 7 environment variables, you can install the following package:

sudo apt-get install oracle-java7-set-default

Via WebUpd8

You don't even need to re-install pycharm it'll switch to the new Java version automatically.

Hope it helps.

查看更多
时光不老,我们不散
5楼-- · 2020-05-19 03:06

The Oracle (Sun) JDK is no longer included by most newer distributions due to restrictions set by Oracle. Instead they ship with OpenSDK. While OpenSDK works for most applications, PyCharm seems to have some issues with it.

You have to install the Oracle (Sun) JDK manually and make sure it's the default JDK or set the appropriate environment variables when launching PyCharm.

查看更多
登录 后发表回答