intellij upgrade from 2020 to 2023 stepping pit record

1. Download the new version intellij

The intellij version on the working machine is the 2020 community edition, which is relatively old and needs to be upgraded. IDE, a productivity-enhancing tool, is quite important, and it is worth spending a little more time studying it. Before the upgrade, I expected that it would not be that simple, but the facts later proved that it was really troublesome. I deliberately recorded the upgrade process to point out the direction for future generations.

First download the new version. There is nothing to say about this. Go directly to the jetbrain official website and download the corresponding intellij version according to your own operating system. My machine is ubuntu. Download the corresponding linux.tar.gz and decompress it.

2. Start intellij to report an error and find the corresponding log file

After decompression, you will get an ideaIC-2023.1 folder, inside the folder is idea-IC-231.8109.175, you can see the structure in it

tree -L 1 idea-IC-231.8109.175

insert image description here

cd to the bin, which contains the idea.sh file. The most ideal situation is to execute the idea.sh file, and then the IDE starts normally. Of course, the ideal situation is impossible to happen, and there are usually various accidents.

When executing idea.sh, an error is reported, and it cannot be started normally. You need to check the log. The location of the files for the 2023 version is

Configuration (idea.config.path) ~/.config/JetBrains/IdeaIC2023.1
plugin (idea.plugins.path) ~/.local/share/JetBrains/IdeaIC2023.1
system (idea.system.path) ~/.cache
/JetBrains/IdeaIC2023.1 log (idea.log.path) ~/.cache/JetBrains/IdeaIC2023.1/log

The log of IDE startup is in ~/.cache/JetBrains/IdeaIC2023.1/log

tree -L 1 log

insert image description here
The startup log is in idea.log.

3. Check the log

In idea.log, start troubleshooting error messages.

2023-04-20 14:16:24,412 [     78] SEVERE - #c.i.i.p.PluginManager - `include` is supported only on a root level ([row,col,system-id]: [718,5,"/home/xxx/.local/share/JetBrains/IdeaIC2023.1/odps-studio-intellij/lib/odps-studio-intellij-3.6.2.jar"])
java.lang.Throwable: `include` is supported only on a root level ([row,col,system-id]: [718,5,"/home/xxx/.local/share/JetBrains/IdeaIC2023.1/odps-studio-intellij/lib/odps-studio-intellij-3.6.2.jar"])
        at com.intellij.openapi.diagnostic.Logger.error(Logger.java:202)
        at com.intellij.ide.plugins.XmlReader.checkXInclude(XmlReader.kt:499)
        at com.intellij.ide.plugins.XmlReader.access$checkXInclude(XmlReader.kt:1)
        at com.intellij.ide.plugins.XmlReader.readExtensions(XmlReader.kt:408)
        at com.intellij.ide.plugins.XmlReader.readRootElementChild(XmlReader.kt:264)
        ...

At first, I saw that the above exception was thrown, and I started to look for related error messages. After looking for a long time, I didn't find any good solution. It was later proved that this thing does not affect normal use for the time being...

Continue to check the log and find the following error log.

2023-04-20 14:16:26,014 [   1680]   INFO - STDERR - Start Failed
2023-04-20 14:16:26,014 [   1680]   INFO - STDERR - Internal error. Please refer to https://jb.gg/ide/critical-startup-errors
2023-04-20 14:16:26,015 [   1681]   INFO - STDERR -
2023-04-20 14:16:26,015 [   1681]   INFO - STDERR - com.intellij.diagnostic.PluginException: Fatal error initializing 'com.aliyun.odps.studio.intellij.StudioMain' [Plugin: OdpsStudio]
2023-04-20 14:16:26,015 [   1681]   INFO - STDERR -     at com.intellij.serviceContainer.ComponentManagerImpl.handleInitComponentError$intellij_platform_serviceContainer(ComponentManagerImpl.kt:612)
2023-04-20 14:16:26,015 [   1681]   INFO - STDERR -     at com.intellij.serviceContainer.MyComponentAdapter.doCreateInstance(MyComponentAdapter.kt:59)
2023-04-20 14:16:26,015 [   1681]   INFO - STDERR -     at com.intellij.serviceContainer.BaseComponentAdapter.doCreateInstance(BaseComponentAdapter.kt:154)
2023-04-20 14:16:26,016 [   1682]   INFO - STDERR -     at com.intellij.serviceContainer.BaseComponentAdapter.createInstance$lambda$1(BaseComponentAdapter.kt:133)
2023-04-20 14:16:26,016 [   1682]   INFO - STDERR -     at com.intellij.openapi.progress.Cancellation.computeInNonCancelableSection(Cancellation.java:99)
2023-04-20 14:16:26,016 [   1682]   INFO - STDERR -     at com.intellij.serviceContainer.BaseComponentAdapter.createInstance(BaseComponentAdapter.kt:132)
2023-04-20 14:16:26,016 [   1682]   INFO - STDERR -     at com.intellij.serviceContainer.BaseComponentAdapter.getInstance(BaseComponentAdapter.kt:92)
2023-04-20 14:16:26,016 [   1682]   INFO - STDERR -     at com.intellij.serviceContainer.BaseComponentAdapter.getInstance$default(BaseComponentAdapter.kt:77)
2023-04-20 14:16:26,017 [   1683]   INFO - STDERR -     at com.intellij.serviceContainer.ComponentManagerImpl$createInitOldComponentsTask$1.invoke(ComponentManagerImpl.kt:428)
2023-04-20 14:16:26,017 [   1683]   INFO - STDERR -     at com.intellij.serviceContainer.ComponentManagerImpl$createInitOldComponentsTask$1.invoke(ComponentManagerImpl.kt:426)
2023-04-20 14:16:26,017 [   1683]   INFO - STDERR -     at com.intellij.idea.ApplicationLoader$initApplicationImpl$appInitializedListeners$1$1$2$1.invokeSuspend(ApplicationLoader.kt:161)
2023-04-20 14:16:26,017 [   1683]   INFO - STDERR -     at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
2023-04-20 14:16:26,017 [   1683]   INFO - STDERR -     at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
2023-04-20 14:16:26,017 [   1683]   INFO - STDERR -     at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
2023-04-20 14:16:26,018 [   1684]   INFO - STDERR -     at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:788)
2023-04-20 14:16:26,018 [   1684]   INFO - STDERR -     at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:739)
2023-04-20 14:16:26,018 [   1684]   INFO - STDERR -     at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:731)
2023-04-20 14:16:26,018 [   1684]   INFO - STDERR -     at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
2023-04-20 14:16:26,018 [   1684]   INFO - STDERR -     at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
2023-04-20 14:16:26,018 [   1684]   INFO - STDERR -     at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:758)
2023-04-20 14:16:26,019 [   1685]   INFO - STDERR -     at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:302)
2023-04-20 14:16:26,019 [   1685]   INFO - STDERR -     at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
2023-04-20 14:16:26,019 [   1685]   INFO - STDERR -     at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
2023-04-20 14:16:26,019 [   1685]   INFO - STDERR -     at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
2023-04-20 14:16:26,019 [   1685]   INFO - STDERR -     at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
2023-04-20 14:16:26,019 [   1685]   INFO - STDERR -     at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
2023-04-20 14:16:26,020 [   1686]   INFO - STDERR -     at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)
2023-04-20 14:16:26,020 [   1686]   INFO - STDERR - Caused by: java.lang.NullPointerException: Cannot invoke "org.apache.log4j.Category.getAllAppenders()" because the return value of "org.apache.log4j.Logger.getParent()" is null
2023-04-20 14:16:26,020 [   1686]   INFO - STDERR -     at com.aliyun.odps.studio.intellij.ide.IntellijLogger.getInstance(IntellijLogger.java:48)
2023-04-20 14:16:26,020 [   1686]   INFO - STDERR -     at com.aliyun.odps.studio.intellij.ide.IntellijLogger.info(IntellijLogger.java:21)
2023-04-20 14:16:26,020 [   1686]   INFO - STDERR -     at com.aliyun.odps.studio.component.util.DerbyDBUtil.initOptionPath(DerbyDBUtil.java:23)
2023-04-20 14:16:26,020 [   1686]   INFO - STDERR -     at com.aliyun.odps.studio.intellij.StudioMain.initComponent(StudioMain.java:94)
2023-04-20 14:16:26,020 [   1686]   INFO - STDERR -     at com.intellij.serviceContainer.MyComponentAdapter.doCreateInstance(MyComponentAdapter.kt:45)
2023-04-20 14:16:26,021 [   1687]   INFO - STDERR -     ... 25 more
2023-04-20 14:16:26,021 [   1687]   INFO - STDERR -
2023-04-20 14:16:26,021 [   1687]   INFO - STDERR - -----
2023-04-20 14:16:26,021 [   1687]   INFO - STDERR - Your JRE: 17.0.6+10-b829.5 amd64 (JetBrains s.r.o.)
2023-04-20 14:16:26,021 [   1687]   INFO - STDERR - /home/xxx/ideaIC-2023.1/idea-IC-231.8109.175/jbr

Internal error. Please refer to https://jb.gg/ide/critical-startup-errors
This sentence is very important, according to this sentence, I found the summary of this old man.

https://intellij-support.jetbrains.com/hc/en-us/articles/360007568559?page=8

There is such a paragraph

There are multiple possible causes for this issue: broken or incompatible plug-in, corrupted IDE installation files, failed patch update, broken caches or damaged configuration.

It may be hard to guess the root case from the exception stacktrace.

Combined with the error message below, it is basically the reason for broken or incompatible plug-in.

Seeing that there is a plugins in the idea-IC-231.8109.175 folder, I thought it was under this folder at first. But after searching for a long time, I didn't find any plug-ins related to OdpsStudio, which is quite depressing, and I don't know why intellij startup has anything to do with aliyun.

Then I remembered that there is also a plugin-related directory
~/.local/share/JetBrains/IdeaIC2023.1

cd to this directory, and found that there is a directory related to OdpsStudio, no matter what happens, delete it directly.

Then execute the idea.sh file, the world is peaceful, and it starts normally.

4. Create a shortcut

It is definitely inconvenient to start by executing idea.sh every time, and you need to create a shortcut to start quickly.

The online tutorials all tell you to create an idea.desktop (should be an old version) file to implement it. But the new version of IntelliJ provides a better way:

There is a create desktop entry option under the Tools menu. Click this option to directly generate the jetbrains-idea-ce.desktop file in /usr/share/applications.

But here comes the important point, I found that every time I click the shortcut, the original 2020 old version of the IDE is started!!!

Tried several times, restarted Dafa and used it, still the same.

Suddenly, a flash of inspiration reminded me of a problem. Is this file originally there? Although the create desktop entry option was executed in the new version of the IDE, the file was not updated.

So delete the original file, click the create desktop entry option again, and then find that the shortcut icon in the application has been updated. Restarting at this time is also the 2023 new version of the IDE, which is a perfect solution.

Guess you like

Origin blog.csdn.net/bitcarmanlee/article/details/130288329