java 如何在 Ubuntu 上更新已安装的 IntelliJ IDEA?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/43727870/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to update already installed IntelliJ IDEA on Ubuntu?
提问by Q-RIUS
Currently, I have IntelliJ IDEA 2016.3 installed in my Ubuntu 16.04 for Java programming. I have installed it through the IntelliJ website and not the 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. I know that in order to install it, I need to download the tar file, untar it inusr/local
, and run idea.sh from the bin folder. 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.
目前,我在 Ubuntu 16.04 中安装了 IntelliJ IDEA 2016.3,用于 Java 编程。我是通过 IntelliJ 网站而不是ppa
. 启动它后,我会update available
在右下角收到通知,单击 后update
,它会打开 IntelliJ IDEA 网页以下载最新的 IDE tar 文件。我知道为了安装它,我需要下载 tar 文件,在usr/local
. 即使这样做之后,当我在 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? 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 平台并将其视为在 Unity Dash 中搜索的结果?我是否可以像更新现有插件并在重新启动 IntelliJ 时看到它们一样更新它?
回答by CrazyCoder
I recommend using Toolbox Appfor the seamless automatic updates.
我建议使用Toolbox App进行无缝自动更新。
If you have upgraded manually, use the Tools
| Create Command-line Launcherand Create Desktop Entryto update the old ones.
如果您已手动升级,请使用Tools
| 创建命令行启动器和创建桌面条目以更新旧的。
回答by Stephane B.
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,我就是这样做的。
- Download the new IntelliJ version's .tar.gz file from Jetbrains website
- Untar the file and put all of its content to the desired location. I put mine in /optfolder for example:
sudo tar -zxf ideaIU-2018.1.tar.gz -C /opt
- Go inside the new IntelliJ's folder and run the idea.shscript. 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).
- 从 Jetbrains 网站下载新 IntelliJ 版本的 .tar.gz 文件
- 解压文件并将其所有内容放到所需位置。我把我的放在/opt文件夹中,例如:
sudo tar -zxf ideaIU-2018.1.tar.gz -C /opt
- 进入新的 IntelliJ 文件夹并运行idea.sh脚本。示例:
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. The problem is that the file (with extension .desktop) that sets up the launcher's icon still points to your old version. You can change that.
此时您已经安装了两个版本,但是当您点击启动器中的 Idea 图标时,您会运行旧版本。问题是设置启动器图标的文件(扩展名为.desktop)仍然指向您的旧版本。你可以改变它。
The desktop file may be in ~/.local/share/application or /usr/share/applications. Mine was in ~/.local/share/applicationand its name was jetbrains-idea.desktop.
桌面文件可能在~/.local/share/application 或 /usr/share/applications 中。我的在~/.local/share/application 中,它的名字是jetbrains-idea.desktop。
Edit jetbrains-idea.desktopfile with your favorite editor and change the values that need to be changed. In my case I only had to change the values of "Icon" and "Exec" properties. Check the real path from your IntelliJ's installation folder (what we did in point 2 above). Example below of my modified .desktopfile:
[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
Save the file and check that its syntax with the command
desktop-file-validate pathOfYour.desktopFile
(no output means all is fine).Update your system with the latest changes for .desktop files:
sudo update-desktop-database
.Check that the icon from the launcher now launches the new version of IntelliJ. If it does not, log off and log on from Ubuntu. That should do.
You can delete the directory of your previous IntelliJ's version + its hidden directory in your home folder.
You may want to update the values of the executable file /usr/local/bin/idea(if it exists) to point to your new version.
使用您喜欢的编辑器编辑jetbrains-idea.desktop文件并更改需要更改的值。就我而言,我只需要更改“Icon”和“Exec”属性的值。检查 IntelliJ 安装文件夹中的真实路径(我们在上面第 2 点中所做的)。下面是我修改后的.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
保存文件并使用命令检查其语法
desktop-file-validate pathOfYour.desktopFile
(没有输出意味着一切正常)。更新你的系统与.desktop文件的最新变化:
sudo update-desktop-database
。检查启动器中的图标现在是否启动了新版本的 IntelliJ。如果没有,请注销并从 Ubuntu 登录。那应该做。
您可以删除您以前的 IntelliJ 版本的目录 + 其在您的主文件夹中的隐藏目录。
您可能希望更新可执行文件/usr/local/bin/idea(如果存在)的值以指向您的新版本。
回答by liushan CHEN
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.的解决方案的前三步
- Download the new IntelliJ version's .tar.gz file from Jetbrains website
- 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
- Go inside the new IntelliJ's folder and run the idea.sh script. 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).At this moment you have two versions installed but you run the old one when clicking on the Idea icon from the launcher.
- 从 Jetbrains 网站下载新 IntelliJ 版本的 .tar.gz 文件
- 解压文件并将其所有内容放到所需位置。我把我的放在 /opt 文件夹中,例如:
sudo tar -zxf ideaIU-2018.1.tar.gz -C /opt
- 进入新的 IntelliJ 文件夹并运行 idea.sh 脚本。示例:
cd /opt/idea-IU-181.4203.550/bin
然后./idea.sh
按照说明操作(选择从以前的 Idea 版本导入设置的选项)。此时您已经安装了两个版本,但是当您点击启动器中的 Idea 图标时,您会运行旧版本。
To start the new version intelliJ from the launcher:
从启动器启动新版本的 intelliJ:
In the new versionIntelliJ, click
Configure -> Create Desktop Entry
. Now you can start new version from the launcher.(Optional) You may want to delete the old one.
sudo rm -rf /opt/idea-xxx-old-version-xxx
在新版本的IntelliJ 中,单击
Configure -> Create Desktop Entry
。现在您可以从启动器启动新版本。(可选)您可能想要删除旧的。
sudo rm -rf /opt/idea-xxx-old-version-xxx
回答by Mr_Moneybags
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 上测试成功)。