在Linux桌面下装置PyCharm的时候呈现如下报错
root@ubuntu:~# cd pycharm-community-2021.1.1root@ubuntu:~/pycharm-community-2021.1.1# lsbin classpath.txt Install-Linux-tar.txt licensebrokenPlugins.db help jbr pluginsbuild.txt icons.db lib product-info.jsonroot@ubuntu:~/pycharm-community-2021.1.1# cd bin/root@ubuntu:~/pycharm-community-2021.1.1/bin# lsformat.sh inspect.sh printenv.py pycharm.svgfsnotifier libdbm64.so pycharm64.vmoptions pycharm.vmoptionsfsnotifier64 log.xml pycharm.png restart.pyidea.properties ltedit.sh pycharm.shroot@ubuntu:~/pycharm-community-2021.1.1/bin# ./pycharm.sh Error: A JNI error has occurred, please check your installation and try againException in thread "main" java.lang.UnsupportedClassVersionError: com/intellij/idea/Main has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:756) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:468) at java.net.URLClassLoader.access$100(URLClassLoader.java:74) at java.net.URLClassLoader$1.run(URLClassLoader.java:369) at java.net.URLClassLoader$1.run(URLClassLoader.java:363) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:362) at java.lang.ClassLoader.loadClass(ClassLoader.java:418) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355) at java.lang.ClassLoader.loadClass(ClassLoader.java:351) at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:601)root@ubuntu:~/pycharm-community-2021.1.1/bin#
此问题为Java版本太低,须要应用新的jdk版本
49 = Java 550 = Java 651 = Java 752 = Java 853 = Java 954 = Java 1055 = Java 1156 = Java 1257 = Java 1358 = Java 1459 = Java 1560 = Java 16
装置Java
root@ubuntu:~# tar xvf jdk-16.0.1_linux-aarch64_bin.tar.gz root@ubuntu:~# mv jdk-16.0.1 /usr/local/root@ubuntu:~# cd /usr/local/root@ubuntu:/usr/local# lsAscend dcmi games jdk-16.0.1 lib python3.7.5 sharebin etc include jdk1.8.0_291 man sbin srcroot@ubuntu:/usr/local# vim /etc/profileroot@ubuntu:/usr/local# source /etc/profile
环境变量配置文件
root@ubuntu:/usr/local# cat /etc/profile# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).if [ "${PS1-}" ]; then if [ "${BASH-}" ] && [ "$BASH" != "/bin/sh" ]; then # The file bash.bashrc already sets the default PS1. # PS1='\h:\w\$ ' if [ -f /etc/bash.bashrc ]; then . /etc/bash.bashrc fi else if [ "`id -u`" -eq 0 ]; then PS1='# ' else PS1='$ ' fi fifiif [ -d /etc/profile.d ]; then for i in /etc/profile.d/*.sh; do if [ -r $i ]; then . $i fi done unset ifi#用于设置python3.7.5库文件门路export LD_LIBRARY_PATH=/usr/local/python3.7.5/lib:$LD_LIBRARY_PATH#如果用户环境存在多个python3版本,则指定应用python3.7.5版本export PATH=/usr/local/python3.7.5/bin:$PATH# control log level. 0-DEBUG, 1-INFO, 2-WARNING, 3-ERROR, default level is WARNING.export GLOG_v=2# Conda environmental optionsLOCAL_ASCEND=/usr/local/Ascend # the root directory of run package# lib libraries that the run package depends onexport LD_LIBRARY_PATH=${LOCAL_ASCEND}/add-ons/:${LOCAL_ASCEND}/ascend-toolkit/latest/fwkacllib/lib64:${LOCAL_ASCEND}/driver/lib64:${LOCAL_ASCEND}/ascend-toolkit/latest/opp/op_impl/built-in/ai_core/tbe/op_tiling:${LD_LIBRARY_PATH}# Environment variables that must be configuredexport TBE_IMPL_PATH=${LOCAL_ASCEND}/ascend-toolkit/latest/opp/op_impl/built-in/ai_core/tbe # TBE operator implementation tool pathexport ASCEND_OPP_PATH=${LOCAL_ASCEND}/ascend-toolkit/latest/opp # OPP pathexport PATH=${LOCAL_ASCEND}/ascend-toolkit/latest/fwkacllib/ccec_compiler/bin/:${PATH} # TBE operator compilation tool pathexport PYTHONPATH=${TBE_IMPL_PATH}:${PYTHONPATH} # Python library that TBE implementation depends onexport JAVA_HOME=/usr/local/jdk-16.0.1export JRE_HOME=/usr/local/jdk-16.0.1/jre/export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/libexport PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH:$HOME/binroot@ubuntu:/usr/local#