简体   繁体   English

如何在Ubuntu上更新已安装的IntelliJ IDEA?

[英]How to update already installed IntelliJ IDEA on Ubuntu?

Currently, I have IntelliJ IDEA 2016.3 installed in my Ubuntu 16.04 for Java programming. 目前,我在我的Ubuntu 16.04中安装了IntelliJ IDEA 2016.3用于Java编程。 I have installed it through the IntelliJ website and not the ppa . 我已经通过IntelliJ网站而不是ppa安装了它。 Upon launching it, I get an update available notification on bottom right corner and upon clicking update , it opens the IntelliJ IDEA webpage for downloading the latest IDE tar file. 启动后,我会在右下角收到update available通知,点击update ,会打开IntelliJ IDEA网页以下载最新的IDE tar文件。 I know that in order to install it, I need to download the tar file, untar it in usr/local , and run idea.sh from the bin folder. 我知道为了安装它,我需要下载tar文件,在usr/local解压缩,然后从bin文件夹运行idea.sh。 Even after doing that, when I search for IntelliJ in the Unity Dash, I see the icon for the old 2016.3 version and upon clicking it, it opens the same old version. 即使这样做,当我在Unity Dash中搜索IntelliJ时,我看到旧版2016.3版本的图标,点击它后,它会打开相同的旧版本。

So my question is, how can I update the entire existing IntelliJ platform and see it as the result upon search in the Unity Dash? 所以我的问题是,如何在Unity Dash中搜索时更新整个现有的IntelliJ平台并将其视为结果? Can I update it in the same way in which I can update the existing plug-ins and see them in effect upon restarting IntelliJ? 我能否以更新现有插件的方式更新它,并在重新启动IntelliJ时看到它们生效?

I recommend using Toolbox App for the seamless automatic updates. 我建议使用Toolbox App进行无缝自动更新。

If you have upgraded manually, use the Tools | 如果已手动升级,请使用Tools | Create Command-line Launcher and Create Desktop Entry to update the old ones. 创建命令行启动器创建桌面条目以更新旧的。

I also suggest to use ToolBox but in case it is not an option, I just upgraded from IntelliJ 173 to 181 in Ubuntu 16.04 manually and I did it like this. 我还建议使用ToolBox但是如果它不是一个选项,我只是手动从Ubuntu 16.04中的IntelliJ 173升级到181,我这样做了。

  1. Download the new IntelliJ version's .tar.gz file from Jetbrains website 从Jetbrains网站下载新的IntelliJ版本的.tar.gz文件
  2. Untar the file and put all of its content to the desired location. 解压缩文件并将其所有内容放到所需位置。 I put mine in /opt folder for example: sudo tar -zxf ideaIU-2018.1.tar.gz -C /opt 我把我放在/ opt文件夹中,例如: sudo tar -zxf ideaIU-2018.1.tar.gz -C /opt
  3. Go inside the new IntelliJ's folder and run the idea.sh script. 进入新的IntelliJ文件夹并运行idea.sh脚本。 Example: cd /opt/idea-IU-181.4203.550/bin then ./idea.sh and follow the instructions (select the option to import your settings from your previous Idea's version). 示例: cd /opt/idea-IU-181.4203.550/bin然后./idea.sh并按照说明操作(选择从以前的Idea版本导入设置的选项)。

At this moment you have two versions installed but you run the old one when clicking on the Idea icon from the launcher. 此时您已安装了两个版本,但在点击启动器中的Idea图标时运行旧版本。 The problem is that the file (with extension .desktop ) that sets up the launcher's icon still points to your old version. 问题是设置启动器图标的文件(扩展名为.desktop )仍指向旧版本。 You can change that. 你可以改变它。

The desktop file may be in ~/.local/share/application or /usr/share/applications . 桌面文件可能位于〜/ .local / share / application或/ usr / share / applications中 Mine was in ~/.local/share/application and its name was jetbrains-idea.desktop . 我在〜/ .local / share / application中 ,它的名字是jetbrains-idea.desktop

  1. Edit jetbrains-idea.desktop file with your favorite editor and change the values that need to be changed. 使用您喜欢的编辑器编辑jetbrains-idea.desktop文件,并更改需要更改的值。 In my case I only had to change the values of "Icon" and "Exec" properties. 在我的情况下,我只需要更改“Icon”和“Exec”属性的值。 Check the real path from your IntelliJ's installation folder (what we did in point 2 above). 检查IntelliJ安装文件夹中的实际路径(我们在上面的第2点中所做的)。 Example below of my modified .desktop file: 我修改过的.desktop文件的示例如下:

     [Desktop Entry] Version=1.0 Type=Application Name=IntelliJ IDEA Ultimate Edition Icon=/opt/idea-IU-181.4203.550/bin/idea.png Exec="/opt/idea-IU-181.4203.550/bin/idea.sh" %f Comment=The Drive to Develop Categories=Development;IDE; Terminal=false StartupWMClass=jetbrains-idea 
  2. Save the file and check that its syntax with the command desktop-file-validate pathOfYour.desktopFile (no output means all is fine). 保存文件,并使用命令desktop-file-validate pathOfYour.desktopFile检查其语法(没有输出表示一切正常)。

  3. Update your system with the latest changes for .desktop files: sudo update-desktop-database . 使用.desktop文件的最新更改更新系统: sudo update-desktop-database

  4. Check that the icon from the launcher now launches the new version of IntelliJ. 检查启动器中的图标现在是否启动了新版本的IntelliJ。 If it does not, log off and log on from Ubuntu. 如果没有,请注销并从Ubuntu登录。 That should do. 那应该做。

  5. You can delete the directory of your previous IntelliJ's version + its hidden directory in your home folder. 您可以删除以前IntelliJ版本的目录+其主文件夹中的隐藏目录。

  6. You may want to update the values of the executable file /usr/local/bin/idea (if it exists) to point to your new version. 您可能希望更新可执行文件/ usr / local / bin / idea (如果存在)的值以指向新版本。

In case anyone still needs an optional solution. 万一有人还需要一个可选的解决方案。

First of all, just install the new version IntelliJ as the first three steps of @Stephane B.'s solution 首先,只需安装新版IntelliJ作为@Stephane B.解决方案的前三个步骤

  1. Download the new IntelliJ version's .tar.gz file from Jetbrains website 从Jetbrains网站下载新的IntelliJ版本的.tar.gz文件
  2. Untar the file and put all of its content to the desired location. 解压缩文件并将其所有内容放到所需位置。 I put mine in /opt folder for example: sudo tar -zxf ideaIU-2018.1.tar.gz -C /opt 我把我放在/ opt文件夹中,例如: sudo tar -zxf ideaIU-2018.1.tar.gz -C /opt
  3. Go inside the new IntelliJ's folder and run the idea.sh script. 进入新的IntelliJ文件夹并运行idea.sh脚本。 Example: cd /opt/idea-IU-181.4203.550/bin then ./idea.sh and follow the instructions (select the option to import your settings from your previous Idea's version). 示例: cd /opt/idea-IU-181.4203.550/bin然后./idea.sh并按照说明操作(选择从以前的Idea版本导入设置的选项)。

At this moment you have two versions installed but you run the old one when clicking on the Idea icon from the launcher. 此时您已安装了两个版本,但在点击启动器中的Idea图标时运行旧版本。

To start the new version intelliJ from the launcher: 要从启动器启动新版本intelliJ:

  1. In the new version IntelliJ, click Configure -> Create Desktop Entry . 新版 IntelliJ中,单击Configure -> Create Desktop Entry Now you can start new version from the launcher. 现在您可以从启动器启动新版本。

  2. (Optional) You may want to delete the old one. (可选)您可能想要删除旧的。 sudo rm -rf /opt/idea-xxx-old-version-xxx

If you are an admin on your system, you are usually in the sudo group 如果您是系统管理员,则通常在sudo组中

# This will change the group of Intellij folder, subfolders and files to a
# likely existing admin group `sudo` that you will likely be apart of as an admin.
sudo chgrp -R sudo /opt/intellij-idea-community

# Add `+` `w`rite permission for `g`roup for the Intellij folder, subfolders and files
sudo chmod -R g+w /opt/intellij-idea-community

Now you should be able to run the update from the UI (Tested successfully on Ubuntu 14.04). 现在您应该能够从UI运行更新(在Ubuntu 14.04上成功测试)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM