Error occurred during initialization of vm intellij idea

Ответили на вопрос 3 человека. Оцените лучшие ответы! И подпишитесь на вопрос, чтобы узнавать о появлении новых ответов.

Собственно скачал IntelliJ IDEA, написал примитивный «Hello World!»

fun main() {
    println("Hello World!")
}

И при первом же запуске вылетела такая ошибка: «Error:Abnormal build process termination: » дальше было куча названий папок и после такое: «Error occurred during initialization of VM
Failed setting boot class path». Кто может подсказать как с этим побороться?


  • Вопрос задан

    более двух лет назад

  • 1497 просмотров

Пригласить эксперта

Была абсолютно аналогичная проблема, тоже недавно начал изучать Kotlin. JDK 14.0.1 тоже скачивал автоматически, используя IDE.
Снёс IntelliJ Idea полностью, перекачал новую версию с их сайта. JDK установил по ссылке выше в комментариях, и вместо автоматической закачки указал путь на папку. Проблема исчезла и хелловорд заработал.
Магия, не иначе, ибо в чём была проблема и почему intellij IDEA не нравится автоматически закаченный ею jdk — непонятно.


  • Показать ещё
    Загружается…

09 февр. 2023, в 17:37

5000 руб./за проект

09 февр. 2023, в 17:35

50000 руб./за проект

09 февр. 2023, в 17:25

3800 руб./за проект

Минуточку внимания

Здравствуйте при первой работе с IntelliJ IDEA произошел ряд проблем. Сначала была неактивна кнопка, которая потом неизвестным образом стала активной. Затем при запуске простейшей программы выскакивает большая ошибка. Прошу помочь объяснить полному чайнику и новичку. Заранее спасибо. Скрин прикрепляю…

P.S.
Код ошибки:
Error:Abnormal build process termination:
C:UsersМаксим.jdksopenjdk-14.0.1-1binjava.exe -Xmx700m -Djava.awt.headless=true -Djdt.compiler.useSingleThread=true -Dcompile.parallel=false -Drebuild.on.dependency.change=true -Dio.netty.initialSeedUniquifier=5479704782666428160 -Dfile.encoding=windows-1251 -Duser.language=ru -Duser.country=RU -Didea.paths.selector=IdeaIC2020.1 «-Didea.home.path=C:Program FilesJetBrainsIntelliJ IDEA Community Edition 2020.1.1» -Didea.config.path=C:UsersМаксимAppDataRoamingJetBrainsIdeaIC2020.1 -Didea.plugins.path=C:UsersМаксимAppDataRoamingJetBrainsIdeaIC2020.1plugins -Djps.log.dir=C:/Users/Максим/AppData/Local/JetBrains/IdeaIC2020.1/log/build-log «-Djps.fallback.jdk.home=C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/jbr» -Djps.fallback.jdk.version=11.0.6 -Dio.netty.noUnsafe=true -Djava.io.tmpdir=C:/Users/Максим/AppData/Local/JetBrains/IdeaIC2020.1/compile-server/parasha_bbf4a56e/_temp_ -Djps.backward.ref.index.builder=true -Dkotlin.incremental.compilation=true -Dkotlin.incremental.compilation.js=true -Dkotlin.daemon.enabled -Dkotlin.daemon.client.alive.path=»C:Users2BA0~1AppDataLocalTempkotlin-idea-11727638608993171776-is-running» -classpath «C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/plugins/java/lib/jps-launcher.jar» org.jetbrains.jps.cmdline.Launcher «C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/plugins/java/lib/maven-resolver-connector-basic-1.3.3.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/lib/commons-logging-1.2.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/lib/netty-resolver-4.1.47.Final.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/lib/maven-resolver-util-1.3.3.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/lib/util.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/lib/annotations.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/plugins/java/lib/maven-resolver-transport-file-1.3.3.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/lib/plexus-utils-3.2.0.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/lib/httpclient-4.5.12.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/plugins/java/lib/jps-builders.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/lib/jna.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/lib/qdox-2.0-M10.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/lib/forms-1.1-preview.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/lib/maven-repository-metadata-3.6.1.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/lib/resources_en.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/lib/maven-model-3.6.1.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/lib/netty-transport-4.1.47.Final.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/lib/maven-builder-support-3.6.1.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/lib/idea_rt.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/lib/plexus-component-annotations-1.7.1.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/lib/maven-resolver-spi-1.3.3.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/lib/netty-common-4.1.47.Final.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/plugins/java/lib/javac2.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/plugins/java/lib/jps-builders-6.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/lib/jdom.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/lib/maven-resolver-impl-1.3.3.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/lib/maven-resolver-provider-3.6.1.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community

Edition 2020.1.1/lib/maven-artifact-3.6.1.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/lib/slf4j-api-1.7.25.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/plugins/java/lib/maven-resolver-transport-http-1.3.3.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/lib/jna-platform.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/lib/guava-28.2-jre.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/lib/oro-2.0.8.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/plugins/java/lib/aether-dependency-resolver.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/lib/gson-2.8.6.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/lib/nanoxml-2.2.3.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/lib/log4j.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/lib/httpcore-4.4.13.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/lib/protobuf-java-3.5.1.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/lib/commons-lang3-3.9.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/lib/plexus-interpolation-1.25.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/lib/maven-model-builder-3.6.1.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/lib/jps-model.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/lib/asm-all-7.0.1.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/lib/platform-api.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/lib/lz4-java-1.7.1.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/lib/maven-resolver-api-1.3.3.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/lib/trove4j.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/lib/netty-buffer-4.1.47.Final.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/lib/netty-codec-4.1.47.Final.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/lib/gson-2.8.6.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/plugins/android/lib/jarutils.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/lib/guava-28.2-jre.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/plugins/android/lib/common-26.6.0.2.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/plugins/gradle/lib/gradle-api-6.1.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/lib/gson-2.8.6.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/plugins/android/lib/jarutils.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/lib/guava-28.2-jre.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/plugins/android/lib/common-26.6.0.2.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/plugins/gradle/lib/gradle-api-6.1.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/plugins/IntelliLang/lib/intellilang-jps-plugin.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/plugins/eclipse/lib/eclipse-jps-plugin.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/plugins/eclipse/lib/common-eclipse-util.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/plugins/ant/lib/ant-jps-plugin.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/plugins/Groovy/lib/groovy-jps-plugin.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/plugins/Groovy/lib/groovy-rt-constants.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/plugins/maven/lib/maven-jps-plugin.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/plugins/gradle-java/lib/gradle-jps-plugin.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition

2020.1.1/plugins/Kotlin/lib/jps/kotlin-jps-plugin.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/plugins/Kotlin/lib/kotlin-stdlib.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/plugins/Kotlin/lib/kotlin-reflect.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/plugins/Kotlin/lib/kotlin-plugin.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/plugins/uiDesigner/lib/jps/ui-designer-jps-plugin.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/plugins/devkit/lib/devkit-jps-plugin.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/plugins/javaFX/lib/javaFX-jps-plugin.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/plugins/javaFX/lib/common-javaFX-plugin.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/plugins/android/lib/jps/android-jps-plugin.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/plugins/android/lib/android-common.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/plugins/android/lib/build-common.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/plugins/android/lib/android-rt.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/plugins/android/lib/android-extensions-ide.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/plugins/android/lib/sdk-common-26.6.0.2.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/plugins/android/lib/common-26.6.0.2.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/plugins/android/lib/repository-26.6.0.2.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/plugins/android/lib/sdklib-26.6.0.2.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/plugins/android/lib/jarutils.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/plugins/android/lib/layoutlib-api-26.6.0.2.jar;C:/Program Files/JetBrains/IntelliJ IDEA Community Edition 2020.1.1/plugins/android/lib/manifest-merger-26.6.0.2.jar» org.jetbrains.jps.cmdline.BuildMain 127.0.0.1 60930 4208c212-fe6b-48e9-bb40-0872d6df1c05 C:/Users/Максим/AppData/Local/JetBrains/IdeaIC2020.1/compile-server
Error occurred during initialization of VM
Failed setting boot class path.

  1. HowTo
  2. Java Howtos
  3. Error Occurred During Initialization of …
Error Occurred During Initialization of VM Java/Lang/Noclassdeffounderror: Java/Lang/Object

This tutorial demonstrates the Error occurred during initialization of VM java/lang/noclassdeffounderror: java/lang/object error in Java.

Error Occurred During Initialization of VM java/lang/noclassdeffounderror: java/lang/object

The Error occurred during initialization of VM java/lang/noclassdeffounderror: java/lang/object occurs when systems get confused when running Java. This occurs when we run Java as an environment variable, but running Java from its directory will work properly.

Whenever Error occurred during initialization of VM java/lang/noclassdeffounderror: java/lang/object occurs, Java is installed properly, and the correct path is set for the environment variables.

The reasons for this error are ambiguous, but some solutions can be applied in different scenarios. The reasons include:

  1. When we updated the Java Development Kit (JDK) but forgot to update the Java Runtime Environment (JRE). In the recent versions, JRE is included in the JDK, so we don’t have to install it separately.
  2. When an unknown application has copied java.exe files to the Windows directory, and Windows start running Java from the Windows directory, this error will occur when the supportive files are not found.

The error looks like this when we run Java in the CMD:

Error occurred during initialization of VM
java/lang/noclassdeffounderror: java/lang/object

Running Eclipse

Usually, when this error stops Eclipse from initializing. The Eclipse problem can be solved following the steps below.

  • Go to the Eclipse directory.
  • Open the eclipse.ini file.
  • Add the following lines with your path to the ini file before the vmargs:
-vm
C:Program FilesJavajdk1.7.0_10binjavaw.exe

Save the eclipse.ini file and run Eclipse.

Check the Windows Directory

If the Error Occurred During Initialization of VM java/lang/noclassdeffounderror: java/lang/object error is occurring, then you should follow some steps to know the ambiguous reasons:

  1. Go to the Windows directory.
  2. Check if you can find the exe file from Java.
  3. These files are copied by an application on Windows.
  4. Deleting these files may solve the problem.
  5. Finding the application is not easy, but you can check all the applications running Java.

Sheeraz Gul avatar
Sheeraz Gul avatar

Sheeraz is a Doctorate fellow in Computer Science at Northwestern Polytechnical University, Xian, China. He has 7 years of Software Development experience in AI, Web, Database, and Desktop technologies. He writes tutorials in Java, PHP, Python, GoLang, R, etc., to help beginners learn the field of Computer Science.

LinkedIn
Facebook

Related Article — Java JVM

  • JVM -XSS Option
  • Increase Virtual Memory in Java
  • Find Java Virtual Machine DLL

    Related Article — Java Error

  • Java.Lang.VerifyError: Bad Type on Operand Stack
  • Error Opening Registry Key ‘Software JavaSoft Java Runtime Environment.3’ in Java
  • Identifier Expected Error in Java
  • Error: Class, Interface, or Enum Expected in Java
  • Unreported Exception Must Be Caught or Declared to Be Thrown
  • Java.Lang.OutOfMemoryError: Unable to Create New Native ThreadEzoic
  • In this post, we will see an error(Could not reserve enough space for 2097152kb object heap object heap) which you might have encountered while dealing with JVM.We will see how can we fix this issue.

    Table of Contents

    • Heap size
      • Maximum heap size
    • Cause 1: Did not specify heap size
      • Fix 1
    • Cause 2: Too large Xmx value
      • Fix 2
    • Cause 3: Specifying large heap size more than physical memory
      • Fix 3
      • Set _JAVA_OPTIONS environment variable
    • Could not reserve enough space for 2097152kb object heap
      • Apache cordova
      • Minecraft
      • Jfrog artifactory
    • Conclusion

    error occurred during initialization of vm could not reserve enough space for 2097152kb object heap is generally raised when Java process can not create java virtual machine due to memory limitations.

    Before we go through causes and fixes for this issue, let’s go through few basic things.

    Heap size

    Heap size is memory allocation space for storing java objects at run time. This heap size can have minimum and maxiumn heap size. You can specify minimum and maximum size using Xmx and Xms VM arguments.

    Maximum heap size

    The maximum possible heap size can be determined by available memory space. It is different on 32 bit and 64 bit as follows.

    1. 2^32 (~4GB) on 32 bit JVM
    2. 2^64 (~16EB) on 64 bit JVM.

    In general, you will get 1.4-1.6 GB on 32 bit windows and approximately 3GB on on 32 bit linux.

    If you require large heap, then you should generally use 64 bit JVM.

    Cause 1: Did not specify heap size

    Let’s say you run your java program without specifying any heap size and you get below error.

    Error occurred during initialization of VM
    Could not reserve enough space for object heap
    Could not create the Java virtual machine.

    You will get this error more often in 32 bit JVM rather than 64-bit JVM

    Reason
    32-bit Java requires contiguous free space in memory to run. If you specify a large heap size, there may not be so much contiguous free space in memory even if you have much more free space available than necessary.
    Installing 64-bit version might solve this issue in this case.

    Fix 1

    You can fix this error by running Java with lower heap size such as -Xmx512m.

    java Xmx512M MyApplication

    Cause 2: Too large Xmx value

    If you specify too large memory with -Xmx option on 32 bit VM, you may also get this error.
    For example:
    Let’s say you are getting an error with below execution.

    java Xms1536M Xmx1536M MyApplication

    Fix 2

    You might not have enough contiguous free space in memory.You can run the application with slightly lower heap size to resolve the issue.

    javaXms1336M Xmx1336M MyApplication

    Cause 3: Specifying large heap size more than physical memory

    If you specify large heap size more than physical memory available on 64-bit or 32-bit  machine, you will get this error.
    For example:
    Let’s say You have 3 GB RAM on your machine and you are executing below command, you will get this error.

    java Xms4096M Xmx4096M MyApplication

    Fix 3

    You can run the application with heap size which is less than your physical memory.

    javaXms2048M Xmx2048M MyApplication

    Sometimes above solutions might not work.

    Set _JAVA_OPTIONS environment variable

    So you can set _JAVA_OPTIONS as the environment variable.

    In Linux

    -bash-3.2$ export _JAVA_OPTIONS =»-Xmx512M»
    -bash-3.2$ javac MyApp.java

    In Window

    Go to Start->Control Panel->System->Advanced(tab)->Environment Variables->System
    Variables->New: Variable name: _JAVA_OPTIONS
    Variable value: -Xmx512M

    💡 Did you know?

    JDK_JAVA_OPTIONS is prefered environment variable from Java 9+ onward to specify Java options. It will be ignored in the version lesser than Java 9.

    You might get an specific error Could not reserve enough space for 2097152kb object heap in case you are using any tool. It simply means that JVM is not able to acquire 2 GB heap space which is required by the tool by default.

    Apache cordova

    Apache Cordova is a mobile application development framework originally created by Nitobi.
    If you are getting this error on Apache cordova, here are solutions.

    1. Switch from 32 bit JVM to 64 bit JVM
    2. set _JAVA_OPTIONS environment variable with -Xmx512M
    3. Change

      args.push(‘-Dorg.gradle.jvmargs=-Xmx2048m’)

      to  

      args.push(‘-Dorg.gradle.jvmargs=-Xmx1024m’);

      on the following files located on your machine.

      project-folderplatformsandroidcordovalibbuildersbuilders.js
      project-folderplatformsandroidcordovalibbuildersGradleBuilder.js
      project-folderplatformsandroidcordovalibbuildersStudioBuilder.js

    Minecraft

    If you are getting this error, while launching Minecraft game, then you need to switch from 32 bit JVM to 64 bit JVM.

    Jfrog artifactory

    If you are using JFrom artifactory as artifact life-cycle management tool and getting Could not reserve enough space for 2097152kb object heap while launching it.
    Go to bin directory of your JFrog Artifactory installation, change following line in arifactory.bat file.

    set JAVA_OPTIONS=-server Xms512m Xmx2g Xss256k XX:+UseG1GC

    to

    set JAVA_OPTIONS=-server Xms512m Xmx1024m Xss256k XX:+UseG1GC

    This should resolve this error for JFrog Artifactory installation.

    Conclusion

    • If you might have installed 32 bit JVM in 64 bit machine.Upon uninstalling that version and installing 64 bit version of Java
    • You might have provided too large heap size which might be greater than physical memory. In this case, you need to reduce heap size of JVM.
    • If above solution does not work, you can set JAVA_OPTS as the environment variable to solve this issue. If you set JAVA_OPTS environment variable, then each JVM initialization will automatically use configuration from this environment variable

    I hope this will resolve your issue with error occurred during initialization of vm could not reserve enough space for 2097152kb object heap.

    Пытался установить модуль с помощью maven в IntelliJ IDEA. При этом возникла следующая ошибка

    Error occurred during initialization of VM
    Could not reserve enough space for object heap
    Could not create the Java virtual machine.
    [INFO] ------------------------------------------------------------------------
    [ERROR] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] There are test failures.
    

    Мои вопросы:

    1. Это связано с настройками размера виртуальной машины в файле idea/bin/vmoptions? Будет ли его увеличение иметь значение?
    2. Если да, то как мне это сделать? Поскольку у меня нет необходимых прав для редактирования файла, есть ли другой способ изменить его из IntelliJ, а не редактировать файл?
    3. Если это невозможно, действительно ли стоит запрашивать права администратора для его изменения?

    Редактировать: Текущее содержимое файла vmoptions (используя Intellij ИДЕЯ 8.1.4 )

    -Xms32m
    -Xmx256m
    -XX:MaxPermSize=150m
    -ea
    

    2 ответы

    В этом есть две стороны.

    • Если вы используете 32-разрядную JVM и имеете 4 ГБ или более памяти, возможно, у вас возникла проблема с несмежная память Java. Решением было бы перейти на 64-битную JVM.

    • Если вы уже используете 64-разрядную JVM, увеличьте объем памяти, который вы используете при запуске приложения. Вот некоторые цифры:

      -Xms128m
      -Xmx512m
      -XX:MaxPermSize=300m
      -ea
      

    ответ дан 23 мая ’17, 13:05

    В каталоге установки Intellij есть два файла: idea.exe.vmoptions и idea64.exe.vmoptions. Я какое-то время менял неправильный файл, чтобы увеличить память, и не мог заставить его работать. Откройте соответствующий файл и увеличьте память, как указано в предыдущем ответе, чтобы решить эту проблему.

    Создан 09 июн.

    Не тот ответ, который вы ищете? Просмотрите другие вопросы с метками

    java
    maven
    intellij-idea
    jvm
    size

    or задайте свой вопрос.

    Всем доброго времени суток.

    Собственно проблема с которой столкнулся в названии топика: ошибка синхронизации Gradle при попытке создания проекта Android в IntelliJ IDEA.
    В логе IntelliJ IDEA пишет следующее:

    23:29 Gradle sync started

    23:29

    Gradle sync failed: The newly created daemon process has a different context than expected.
    It won’t be possible to reconnect to this daemon. Context mismatch:
    Java home is different.
    Wanted: DefaultDaemonContext[uid=null,javaHome=D:ITIT-ProgramsIntelliJ IDEA Community Edition 2016.3jre,daemonRegistryDir=C:UsersPazuk.gradl edaemon,pid=2624,idleTimeout=null,daemonOpts=-Xmx1536m,-Dfile.encoding=windows-1251,-Duser.country=RU,-Duser.language=ru,-Duser.variant]
    Actual: DefaultDaemonContext[uid=b0ab2a58-7680-4efa-8ae6-4ed99a898516,javaHome=C:Program FilesJavajdk1.8.0_112,daemonRegistryDir=C:Users Pazuk.gradledaemon,pid=3288,idleTimeout=60000,d aemonOpts=-Xmx1536m,-Dfile.encoding=windows-1251,-Duser.country=RU,-Duser.language=ru,-Duser.variant]
    Consult IDE log for more details (Help | Show Log)

    Ключевые слова тут, как я понимаю, «Java home is different».

    Моя конфигурация:
    Windows 7
    IntelliJ IDEA 2016.3
    Java 8.0.112

    Причем, например, проект в Android Studio у меня создается без данной ошибки.

    До этого также было Gradle sync failed (и в IntelliJ IDEA и в Android Studio). Но по другой причине:

    Error occurred during initialization of VM
    Could not reserve enough space for 1572864KB object heap

    Гуглил на эту тему. На сколько поняв по нагугленому, у меня «джава» ругается на то, что она пытается взять оперативной памяти больше, чем у меня есть свободной (у меня в системе 4Гб). И нужно уменьшить ее аппетиты. По нагугленному проделал следующее:
    по следующему пути: Панель управления>Java>Java>View>Runtime Parametrs прописал «-Xmx768M»
    Чем, на сколько я понял, сделал лимит для джавы в 768Мб.

    После данной операции ошибка ( которая

    Error occurred during initialization of VM
    Could not reserve enough space for 1572864KB object heap

    исчезла). И в Android Studio все стало нормально. А вот в IntelliJ IDEA по прежнему проект не создается. Собственно, по причине сабжа.

    Такие ошибки я нагуглил. Как и варианты их решения.
    Напремер:
    1. Try setting the following in your gradle.properties (either in %USERPROFILE%.gradle or in your project build dir): org.gradle.java.home=C:Program FilesJavajdk1.6.0_45jre

    2. I managed to solve this problem by renaming Info.plist and version.plist to Info.plist.old and version.plist.old in /Applications/IntelliJ IDEA.app/Contents/jre/jdk/Contents folder on Mac.
    After this fix, I also created idea.properties file in ~/Library/Preferences/IntelliJIdea2016.2 and added line gradle.java.home=$(/usr/libexec/java_home)

    3. Would you mind trying removing the ‘org.gradle.java.home’ line from the ‘gradle.properties’ file and setting the ‘JAVA_HOME’ env var with the value?

    4. For whatever reason I had symlink
    /Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/jre/lib/tools.jar pointing to /Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home/lib/tools.jar
    It seems this confuses Gradle. After removing this symlink Gradle works without problems.

    5.Мне помогло следующее:
    1. В папке %USERPROFILE%.gradle следует создать файл «gradle.properties»
    2. В этом файле добавить одну строку:
    org.gradle.java.home=<актуальный путь к jdk>
    в вашем случае:
    org.gradle.java.home=C:/Program Files/Java/jdk1.8.0_112

    Но я не могу разобраться, что они меняют и в каких файлах прописывают указанные вещи. Новичек.
    Вобщем, как-то так.

    Если что, то путь JAVA_HOME в Панель управления>Все элементы панели управления>Система Дополнительные параметры системы>Дополнительно>Переменные среды>Системные переменные у меня прописан к моему фактическому положению папки с JDK. В моем случае это: C:Program filesJavajdk1.8.0_112

    __________________
    Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь

    Понравилась статья? Поделить с друзьями:
  • Error occurred during initialization of vm could not reserve enough space for 3145728kb object heap
  • Error occurred during initialization of vm could not reserve enough space for 3072000kb object heap
  • Error occurred during initialization of vm could not reserve enough space for 2097152kb object heap
  • Error occurred during initialization of vm could not reserve enough space for 2072576kb object heap
  • Error occurred during initialization of vm could not reserve enough space for 2048000kb object heap