9

I've just installed pycharm-community-4.5 into my Ubuntu 14.04 (64 bit). After installing I ran the command /opt/pycharm-community-4.5/bin$ ./pycharm.sh to run pycharm but the terminal showed me some errors as following-

Unrecognized VM option MaxPermSize=350m
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

Here is the result of my java -version :

java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)

How do I fix it?

  • Java, the root of all evil. – Virusboy May 15 '15 at 19:00
  • :( nothing to do. – Abdullah Al Imran May 15 '15 at 19:00
  • MaxPermSize support was removed in Java 8.0. But I can't find the entry. The entry in pycharm.vmoptions does not seem to be working. I have downloaded the latest PyCharm version and it works in Ubuntu 15.04. without a change. – A.B. May 15 '15 at 19:25
  • Do you have a java in the PyCharm installation? The error message does not look like Oracle Java or OpenJDK. – A.B. May 15 '15 at 19:29
  • Edit your question and add the output of echo "$PYCHARM_JDK" – A.B. May 15 '15 at 19:30
8

Open the file pycharm64.vmoptions

nano /opt/pycharm-community-4.5/bin/pycharm64.vmoptions

and add a # at the beginning of the line

# -XX:MaxPermSize=350m

Open the file pycharm.vmoptions

nano /opt/pycharm-community-4.5/bin/pycharm.vmoptions

and add a # at the beginning of the line

# -XX:MaxPermSize=250m

MaxPermSize support was removed in Java 8.0, but the error message

Unrecognized VM option MaxPermSize=350m
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

does not look like Oracle Java 8 or OpenJDK 8.

The PyCharm starter pycharm.sh tries to find Java:

# ---------------------------------------------------------------------
# Locate a JDK installation directory which will be used to run the IDE.
# Try (in order): PYCHARM_JDK, ../jre, JDK_HOME, JAVA_HOME, "java" in PATH.
# ---------------------------------------------------------------------
if [ -n "$PYCHARM_JDK" -a -x "$PYCHARM_JDK/bin/java" ]; then
  JDK="$PYCHARM_JDK"
elif [ -x "$IDE_HOME/jre/bin/java" ] && "$IDE_HOME/jre/bin/java" -version > /dev/null 2>&1 ; then
  JDK="$IDE_HOME/jre"
elif [ -n "$JDK_HOME" -a -x "$JDK_HOME/bin/java" ]; then
  JDK="$JDK_HOME"
elif [ -n "$JAVA_HOME" -a -x "$JAVA_HOME/bin/java" ]; then
  JDK="$JAVA_HOME"
else
  JAVA_BIN_PATH=`which java`
  if [ -n "$JAVA_BIN_PATH" ]; then
    if [ "$OS_TYPE" = "FreeBSD" -o "$OS_TYPE" = "MidnightBSD" ]; then
      JAVA_LOCATION=`JAVAVM_DRYRUN=yes java | "$GREP" '^JAVA_HOME' | "$CUT" -c11-`
      if [ -x "$JAVA_LOCATION/bin/java" ]; then
        JDK="$JAVA_LOCATION"
      fi
    elif [ "$OS_TYPE" = "SunOS" ]; then
      JAVA_LOCATION="/usr/jdk/latest"
      if [ -x "$JAVA_LOCATION/bin/java" ]; then
        JDK="$JAVA_LOCATION"
      fi
    elif [ "$OS_TYPE" = "Darwin" ]; then
      JAVA_LOCATION=`/usr/libexec/java_home`
      if [ -x "$JAVA_LOCATION/bin/java" ]; then
        JDK="$JAVA_LOCATION"
      fi
    fi

    if [ -z "$JDK" -a -x "$READLINK" -a -x "$XARGS" -a -x "$DIRNAME" ]; then
      JAVA_LOCATION=`"$READLINK" -f "$JAVA_BIN_PATH"`
      case "$JAVA_LOCATION" in
        */jre/bin/java)
          JAVA_LOCATION=`echo "$JAVA_LOCATION" | "$XARGS" "$DIRNAME" | "$XARGS" "$DIRNAME" | "$XARGS" "$DIRNAME"`
          if [ ! -d "$JAVA_LOCATION/bin" ]; then
            JAVA_LOCATION="$JAVA_LOCATION/jre"
          fi
          ;;
        *)
          JAVA_LOCATION=`echo "$JAVA_LOCATION" | "$XARGS" "$DIRNAME" | "$XARGS" "$DIRNAME"`
          ;;
      esac
      if [ -x "$JAVA_LOCATION/bin/java" ]; then
        JDK="$JAVA_LOCATION"
      fi
    fi
  fi
fi
  1. $PYCHARM_JDK
  2. $IDE_HOME/jre/bin/java
  3. $JDK_HOME
  4. $JAVA_HOME

Make sure you are using the Java version that you'd like to use.

1

Look inside the bin folder of the pycharm folder you extracted.

There are files called pycharm64.vmoptions and pycharm.vmoptions. Inside them, you can delete the line with the culprit option of MaxPermSize=350m.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.