Error while Running IntelliJ after Community source code build
I have build the IntelliJ IDEA Community Edition source code using my IntelliJ IDEA Ultimate IDE by following the steps provided in https://github.com/JetBrains/intellij-community/blob/master/README.md
While Running IntelliJ IDEA by using Run | Run from the main menu, I am getting an error.
I am attaching the stack trace of the error.
"C:\Program Files\JetBrains\IntelliJ IDEA 2022.3.1\jbr\bin\java.exe" -Xmx512m -XX:ReservedCodeCacheSize=240m -XX:+UseG1GC -XX:SoftRefLRUPolicyMSPerMB=50 -XX:MaxJavaStackTraceDepth=10000 -XX:CICompilerCount=2 -ea -Dsun.io.useCanonCaches=false -Dapple.laf.useScreenMenuBar=true -Dsun.awt.disablegrab=true -Didea.jre.check=true -Didea.is.internal=true -Didea.debug.mode=true -Djdk.attach.allowAttachSelf -Dfus.internal.test.mode=true -Dkotlinx.coroutines.debug=off -Djdk.module.illegalAccess.silent=true -Didea.config.path=../config/idea -Didea.system.path=../system/idea -Didea.initially.ask.config=true -Didea.platform.prefix=Idea -Djava.system.class.loader=com.intellij.util.lang.PathClassLoader "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA 2022.3.1\lib\idea_rt.jar=58225:C:\Program Files\JetBrains\IntelliJ IDEA 2022.3.1\bin" -Dfile.encoding=UTF-8 @C:\Users\***\AppData\Local\Temp\idea_arg_file822152701 com.intellij.idea.Main
Exception in thread "main" java.lang.ExceptionInInitializerError
at org.jetbrains.xxh3.Xxh3.hash(Xxh3.java:54)
at com.intellij.util.lang.ImmutableZipFile.getIndex(ImmutableZipFile.java:89)
at com.intellij.util.lang.ImmutableZipFile.getByteBuffer(ImmutableZipFile.java:165)
at com.intellij.util.lang.ZipResourceFile.findClass(ZipResourceFile.java:105)
at com.intellij.util.lang.JarLoader.findClass(JarLoader.java:63)
at com.intellij.util.lang.ClassPath.findClassInLoader(ClassPath.java:246)
at com.intellij.util.lang.ClassPath.findClassWithoutCache(ClassPath.java:235)
at com.intellij.util.lang.ClassPath.findClass(ClassPath.java:202)
at com.intellij.util.lang.UrlClassLoader.findClass(UrlClassLoader.java:209)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:587)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:435)
at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:503)
Caused by: java.lang.RuntimeException: java.lang.IllegalAccessException: module java.base does not open java.lang to unnamed module @54a097cc
at org.jetbrains.xxh3.StringHash.<clinit>(StringHash.java:23)
... 13 more
Caused by: java.lang.IllegalAccessException: module java.base does not open java.lang to unnamed module @54a097cc
at java.base/java.lang.invoke.MethodHandles.privateLookupIn(MethodHandles.java:259)
at org.jetbrains.xxh3.StringHash.<clinit>(StringHash.java:14)
... 13 more
*** java.lang.instrument ASSERTION FAILED ***: "result" with message agent load/premain call failed at s\src\java.instrument\share\native\libinstrument\JPLISAgent.c line: 422
FATAL ERROR in native method: processing of -javaagent failed, processJavaStart failed
Process finished with exit code 1
Please sign in to leave a comment.
Hello,
Please check related issue on YouTrack: https://youtrack.jetbrains.com/issue/IDEA-299247/intellij-community-throws-exception-on-launch
Hi,
Thanks, I was able to change the VM options and Run from the IntelliJ IDEA Ultimate Edition.
Will I be able to run this without using the IntelliJ IDEA Ultimate Edition as a standalone IDE?
Do you need to run your modified Community Edition? Then you need to create installation package:
"To build installation packages, run the
installers.cmdcommand in<IDEA_HOME>directory.installers.cmdwill work on both Windows and Unix systems."Thanks a lot for the info. It worked :)
You are welcome!
Hi, need one more info.
I had created installation package for IntelliJ IDE by using the "Build IDEA Community Installers (current OS)" run configurations.
Will the same run configuration create installation packages for PyCharm as well or is there a different approach?
I am asking because now my /out/artifacts path does not have the installers for PyCharm.
There is installers.cmd file in "python" folder.
Thanks for the quick reply.
I ran installers.cmd.
It says "Build Successful", but also throws a fatal error.
The /out/artifactory/ path still does not have the PyCharm installers.
I have attached the last part of the build logs.
[resolver:resolve] Downloaded https://cache-redirector.jetbrains.com/download.jetbrains.com/teamcity-repository/org/jetbrains/teamcity/idea/annotations/132.719/annotations-132.719.jar (21 KB at 11.6 KB/sec)
[mkdir] Created dir: C:\Jay\codebase_general\JetBrains\221_Final\intellij-community\out\jps-bootstrap\jps-bootstrap.classes
[javac] Compiling 19 source files to C:\Jay\codebase_general\JetBrains\221_Final\intellij-community\out\jps-bootstrap\jps-bootstrap.classes
[zip] Building zip: C:\Jay\codebase_general\JetBrains\221_Final\intellij-community\out\jps-bootstrap\jps-bootstrap.classes.jar
[mkdir] Created dir: C:\Jay\codebase_general\JetBrains\221_Final\intellij-community\out\jps-bootstrap\jps-bootstrap.out.lib
[sync] Copying 97 resources to C:\Jay\codebase_general\JetBrains\221_Final\intellij-community\out\jps-bootstrap\jps-bootstrap.out.lib
BUILD SUCCESSFUL
Total time: 1 minute 27 seconds
FATAL: java.lang.ArrayIndexOutOfBoundsException: Index 2 out of bounds for length 2
at java.base/java.util.Arrays$ArrayList.get(Arrays.java:4351)
at org.jetbrains.jpsBootstrap.JpsBootstrapMain.<init>(JpsBootstrapMain.java:101)
at org.jetbrains.jpsBootstrap.JpsBootstrapMain.main(JpsBootstrapMain.java:61)
ERROR occurred, see the output above
Hi, in continuation to the above comment..
Should I run the installers.cmd with arguments?
Please try to use IDEA script but change class for PyCharm.
Also you may try Ant script:
```
To build the distribution archive of PyCharm Community Edition, execute build.xml Ant build script in this directory. The results of the build execution can be found at out/artifacts.
```
When I execute the build.xml Ant build script, I am ending up with the same error mention in my previous comment https://intellij-support.jetbrains.com/hc/en-us/community/posts/10011312823442/comments/10177163596562
Could you please elaborate a bit on your suggestion
To build IDEA installation package this script is used:
```
exec "$root/platform/jps-bootstrap/jps-bootstrap.sh" "$@" "$root" intellij.idea.community.build OpenSourceCommunityInstallersBuildTarget
```
but for PyCharm "intellij.pycharm.community.build PyCharmCommunityInstallersBuildTarget" should be used.
So just change it in IDEA build script and try to run.
I did not understand if you are asking me to create a run configuration or change the installers.cmd content.
However I created a kotlin run configuration as below:
And to add on, with the run configuration mentioned above, I got the following error
Please let me know if I have to make any changes in this run configuration.
I meant to change installers.cmd
Hi, tried to change and run installers.cmd
Almost at the end of the build, it failed with the following exception:
Found the solution from here
https://youtrack.jetbrains.com/issue/PY-41471
Does it work fine now?