PHPStorm 无法启动

PHPStorm 无法启动

这是一个非常奇怪的情况...我安装了 PHPStorm,如果我使用终端并输入:/opt/phpstorm/bin/phpstorm.sh

IDE 打开并正常工作。我尝试在 Ubuntu 的主菜单上启动 PHPStorm。因此我在 /usr/share/applications 中创建了 jetbrains-phpstorm.desktop 文件:

[Desktop Entry]
 Version=1.0
 Type=Application
 Name=PhpStorm
 Icon=/opt/phpstorm/bin/webide.png
 Exec=/opt/phpstorm/bin/phpstorm.sh
 Comment=Develop with pleasure!
 Categories=Development;IDE;
 StartupWMClass=jetbrains-phpstorm

我已经检查了权限,所有.desktop文件都具有相同的权限。phpstorm 之前运行良好,这个问题是在我更新 Java 版本后出现的。我之前使用的是 openjdk7,现在更新到 Java 8。请关注我笔记本电脑上的 Java 版本:

Selection    Path                                            Priority   Status
------------------------------------------------------------
* 0            /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java   1071      auto mode
  1            /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java   1071      manual mode
  2            /usr/local/java/jdk1.8.0_65/bin/java             100       manual mode

当我使用选项 2(我更新的新 Java 版本)时出现此错误:

Java HotSpot(TM) Server VM warning: ignoring option MaxPermSize=250m; support was removed in 8.0
Start Failed: Internal error. Please report to https://youtrack.jetbrains.com
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.intellij.ide.Bootstrap.main(Bootstrap.java:39)
at com.intellij.idea.Main.main(Main.java:84)
Caused by: java.lang.UnsatisfiedLinkError: /usr/local/java/jdk1.8.0_65/jre/lib/i386/libawt_xawt.so: libXtst.so.6: cannot open shared object file: No such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1938)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1821)
at java.lang.Runtime.load0(Runtime.java:809)
at java.lang.System.load(System.java:1086)
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1938)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1842)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
at java.awt.Toolkit$3.run(Toolkit.java:1636)
at java.awt.Toolkit$3.run(Toolkit.java:1634)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.loadLibraries(Toolkit.java:1633)
at java.awt.Toolkit.<clinit>(Toolkit.java:1668)
at java.awt.Cursor.<clinit>(Cursor.java:195)
at javax.swing.text.html.HTMLEditorKit.<clinit>(HTMLEditorKit.java:623)
at com.intellij.util.ui.UIUtil.<clinit>(UIUtil.java:96)
at com.intellij.ide.plugins.PluginManager.start(PluginManager.java:71)
... 6 more


Also, an UI exception occurred on attempt to show above message:
java.lang.NoClassDefFoundError: Could not initialize class java.awt.Toolkit
at java.awt.Component.<clinit>(Component.java:593)
at com.intellij.idea.Main.showMessage(Main.java:280)
at com.intellij.idea.Main.showMessage(Main.java:266)
at com.intellij.idea.Main.main(Main.java:87)

对我来说这没有意义,因为我已经检查过文件并且文件libawt_xawt.so:存在且在正确的路径上。有人可以帮助我吗?

答案1

chmod a+x我解决了!我只是运行文件中的命令jetbrains-phpstorm.desktop,他就正常启动了 IDE。

答案2

  1. 右键点击菜单>>配置
  2. 点击打开菜单编辑器
  3. 选择编程>>Phpstorm>>属性
  4. 将命令更改为 snap/phpstorm/38/bin/phpstorm.sh %f

您可以通过输入 sudo location -b phpstorm.sh 来找到安装路径

相关内容