How can I give the Intellij compiler more heap space? - intellij-idea

When I make an Intellij project, I keep getting the following out of memory error.
I already increased my heap size in idea.vmoptions:
-Xms128m
-Xmx2048m
-XX:MaxPermSize=1024m
-XX:ReservedCodeCacheSize=64m
-ea
But I still get this error:
Information:The system is out of resources.
Information:Consult the following stack trace for details.
Information:java.lang.OutOfMemoryError: Java heap space
Information: at com.sun.tools.javac.util.Position$LineMapImpl.build(Position.java:139)
Information: at com.sun.tools.javac.util.Position.makeLineMap(Position.java:63)
Information: at com.sun.tools.javac.parser.Scanner.getLineMap(Scanner.java:1105)
Information: at com.sun.tools.javac.main.JavaCompiler.parse(JavaCompiler.java:512)
Information: at com.sun.tools.javac.main.JavaCompiler.parse(JavaCompiler.java:550)
Information: at com.sun.tools.javac.main.JavaCompiler.parseFiles(JavaCompiler.java:804)
Information: at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:727)
Information: at com.sun.tools.javac.main.Main.compile(Main.java:353)
Information: at com.sun.tools.javac.main.Main.compile(Main.java:279)
Information: at com.sun.tools.javac.main.Main.compile(Main.java:270)
Information: at com.sun.tools.javac.Main.compile(Main.java:69)
Information: at com.sun.tools.javac.Main.main(Main.java:54)
Information: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Information: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
Information: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
Information: at java.lang.reflect.Method.invoke(Method.java:597)
Information: at com.intellij.rt.compiler.JavacRunner.main(JavacRunner.java:71)
Information:Compilation completed with 1 error and 0 warnings
Information:1 error
Information:0 warnings
Error:Compiler internal error. Process terminated with exit code 3
What am I missing?

Current version:
Settings (Preferences on Mac) | Build, Execution, Deployment | Compiler |
Build process heap size.
Older versions:
Settings (Preferences on Mac) | Compiler | Java Compiler | Maximum heap size.
Compiler runs in a separate JVM by default so IDEA heap settings that you set in idea.vmoptions have no effect on the compiler.

Since IntelliJ 2016, the location is File | Settings | Build, Execution, Deployment | Compiler | Build process heap size.

I had a similar problem with Ant build (started by hand from IDEA GUI). In my case there was the right solution to right click on the Ant task, choose properties and set a higher value to "Maximum heap space (Mb):" and "Maximum stack space (Mb):" input fields.

To resolve this issue follow the below given steps-
1). In inteli Go to File> Setting Option and Search for Vm Option In the field of Vm Option for Importer give value -Xmx512m.
Intelij Setting Options
2). Go to Control Pannel Select View by :Large icons then Go to Java one promp window will appear with name java control pannel then go to java
Java VM Options
select view option.
java view options
In Java Run time Environment Setting pass Run time Parameters as -Xmx1024m.
3). If above given options does not work then change the size of pom.xml

GWT in Intellij 12
FWIW, I was getting a similar error with my GWT application during 'Build | Rebuild Project'.
This was caused by Intellij doing a full GWT compile which I didn't like because it is also a very lengthy process.
I disabled GWT compile by turning off the module check boxes under 'Project Structure | Facets | GWT'.
Alternatively there is a 'Compiler maximum heap size' setting in that location as well.

I was facing "java.lang.OutOfMemoryError: Java heap space" error while building my project using maven install command.
I was able to get rid of it by changing maven runner settings.
Settings | Build, Execution, Deployment | Build Tools | Maven | Runner | VM options to -Xmx512m

In my case the error was caused by the insufficient memory allocated to the "test" lifecycle of maven. It was fixed by adding <argLine>-Xms3512m -Xmx3512m</argLine> to:
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.16</version>
<configuration>
<argLine>-Xms3512m -Xmx3512m</argLine>
Thanks #crazycoder for pointing this out (and also that it is not related to IntelliJ; in this case).
If your tests are forked, they run in a new JVM that doesn't inherit Maven JVM options. Custom memory options must be provided via the test runner in pom.xml, refer to Maven documentation for details, it has very little to do with the IDE.

I like to share a revelation that I had. When you build a project, Intellij Idea runs a java process that resides in its core(ex: C:\Program Files\JetBrains\IntelliJ IDEA 2020.3\jbr\bin). The "build process heap size", as mentioned by many others, changes the heap size of this java process. However, the main java process is triggered later by the Idea's java process, hence have different VM arguments. I noticed that the max heap size of this process is 1/3 of the Idea's java process, while min heap is the half of max(1/6). To round up:
When you set 9g heap on "build process heap size" the actual heap size for the compiler is max 3g and min 1,5g. And no need for restart is neccessary.
PS: tested on version 2020.3

On android studio 4.2 or newer Arctic fox version you will option under appearance & behavior
Windows: file > settings > appearance & behavior > system settings > memory settings
Mac: file > preferences > appearance & behavior > system settings > memory settings
https://i.stack.imgur.com/PEqBK.png

There is a
idea64.exe
starter in
IntelliJ IDEA 13.1.5\bin
so you can address more space.

Related

IntelliJ IDEA crash on startup (NoClassDefFoundError: Could not initialize class com.sun.jna.Native)

Okay so I am using Windows 10, I am having issues starting up intelliJ IDEA as every time I run it, it throws the following error and crashes,
Internal error. Please refer to
https://jb.gg/ide/critical-startup-errors
com.intellij.ide.plugins.StartupAbortedException: Cannot start app
at com.intellij.idea.StartupUtil.lambda$start$15(StartupUtil.java:265)
at java.base/java.util.concurrent.CompletableFuture.uniExceptionally(CompletableFuture.java:990)
at java.base/java.util.concurrent.CompletableFuture$UniExceptionally.tryFire(CompletableFuture.java:974)
at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1773)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1760)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class
com.sun.jna.Native
at com.sun.jna.platform.win32.WinReg$HKEYByReference.(WinReg.java:52)
at com.sun.jna.platform.win32.WinReg$HKEYByReference.(WinReg.java:48)
at com.sun.jna.platform.win32.Advapi32Util.registryGetStringValue(Advapi32Util.java:736)
at com.sun.jna.platform.win32.Advapi32Util.registryGetStringValue(Advapi32Util.java:717)
at com.intellij.openapi.util.WinBuildVersionKt.getWinBuildNumberInternal(WinBuildVersion.kt:14)
at com.intellij.openapi.util.WinBuildVersionKt.access$getWinBuildNumberInternal(WinBuildVersion.kt:1)
at com.intellij.openapi.util.WinBuildVersionKt$getWinBuildNumber$1.invoke(WinBuildVersion.kt:33)
at com.intellij.openapi.util.WinBuildVersionKt$getWinBuildNumber$1.invoke(WinBuildVersion.kt)
at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
at com.intellij.openapi.util.WinBuildVersionKt.getWinBuildNumber(WinBuildVersion.kt:33)
at com.intellij.openapi.util.SystemInfo.getWinBuildNumber(SystemInfo.java:123)
at com.intellij.openapi.wm.impl.customFrameDecorations.header.CustomHeader$CustomFrameTopBorder.calculateAffectsBorders(CustomHeader.kt:276)
at com.intellij.openapi.wm.impl.customFrameDecorations.header.CustomHeader$CustomFrameTopBorder.addNotify(CustomHeader.kt:346)
at com.intellij.openapi.wm.impl.customFrameDecorations.header.CustomHeader.addNotify(CustomHeader.kt:158)
at com.intellij.openapi.wm.impl.customFrameDecorations.header.DialogHeader.addNotify(DialogHeader.kt:59)
at java.desktop/java.awt.Container.addNotify(Container.java:2804)
at java.desktop/javax.swing.JComponent.addNotify(JComponent.java:4847)
at java.desktop/java.awt.Container.addNotify(Container.java:2804)
at java.desktop/javax.swing.JComponent.addNotify(JComponent.java:4847)
at java.desktop/java.awt.Container.addNotify(Container.java:2804)
at java.desktop/javax.swing.JComponent.addNotify(JComponent.java:4847)
at java.desktop/javax.swing.JRootPane.addNotify(JRootPane.java:729)
at java.desktop/java.awt.Container.addNotify(Container.java:2804)
at java.desktop/java.awt.Window.addNotify(Window.java:797)
at java.desktop/java.awt.Dialog.addNotify(Dialog.java:770)
at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl$MyDialog.addNotify(DialogWrapperPeerImpl.java:641)
at java.desktop/java.awt.Window.pack(Window.java:835)
at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl.pack(DialogWrapperPeerImpl.java:311)
at com.intellij.openapi.ui.DialogWrapper.pack(DialogWrapper.java:1432)
at com.intellij.ide.gdpr.AgreementUi.pack(AgreementUi.kt:254)
at com.intellij.ide.gdpr.Agreements.showEndUserAndDataSharingAgreements(Agreements.kt:19)
at com.intellij.idea.StartupUtil.lambda$showEuaIfNeeded$25(StartupUtil.java:607)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:779)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:730)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:724)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:749)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:393)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)
----- Your JRE: 17.0.3+7-b469.32 amd64 (JetBrains s.r.o.) C:\Program Files\Jetbrains\IntelliJ IDEA\jbr
Has anyone encountered something like this? I've never seen this issue before so completely clueless, any help would be greatly appreciated.
Thanks a lot
When running the IntelliJ IDEA, a dll
C:\Users<user_name>\AppData\Local\JetBrains\IntelliJIdea2022.2\tmp\jnaxxxx.dll is extracted in IDEA's temp dir and executed.
In Windows, some security tools can restrict the folders where binaries (e.g. dll, ...) can be executed.
If you have security tools installed, ensure that all IDE, project, and IDE installation directories are added to the exclusions list.

Problems in IntelliJ since version 2022.1 / java.lang.NoClassDefFoundError

As of today, when I try to run some of my programs in IntelliJ today, this message was shown:
Executing pre-compile tasks...
Loading Ant configuration...
Running Ant tasks...
Running 'before' tasks
Checking sources
Finished, saving caches…
Module 'Listen' production: java.lang.NoClassDefFoundError: com/intellij/DynamicBundle
Executing post-compile tasks...
Loading Ant configuration...
Running Ant tasks...
Synchronizing output directories...
13.04.22, 14:54 - Build completed with 1 error and 0 warnings in 4 sec, 39 ms
This line is printed in red: Module 'Listen' production: java.lang.NoClassDefFoundError: com/intellij/DynamicBundle
I don't really have too much of an idea where I should look for the problem.
It seems to not have anything to do with the project itself. I already created a new Project and created a Hello World-program, which resulted in the same error.
Remarkably, yesterday my IntelliJ IDEA version was updated to version 2022.1.
Runtime version: 11.0.14.1+1-b2043.25 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
I have no idea either whether it has anything to do with the new version either.
I maintain another Project, which uses Scala language. That one is messed up even more:
Cannot process toolwindow sbt
java.lang.AbstractMethodError: Missing implementation of resolved method 'abstract com.intellij.openapi.externalSystem.settings.AbstractExternalSystemSettings getSettings(com.intellij.openapi.project.Project)' of abstract class com.intellij.openapi.externalSystem.service.task.ui.AbstractExternalSystemToolWindowFactory.
at com.intellij.openapi.externalSystem.service.task.ui.AbstractExternalSystemToolWindowFactory.shouldBeAvailable(AbstractExternalSystemToolWindowFactory.java:35)
at com.intellij.toolWindow.ToolWindowSetInitializerKt.beanToTask(ToolWindowSetInitializer.kt:262)
at com.intellij.toolWindow.ToolWindowSetInitializerKt.beanToTask(ToolWindowSetInitializer.kt:248)
at com.intellij.toolWindow.ToolWindowSetInitializerKt.access$beanToTask(ToolWindowSetInitializer.kt:1)
at com.intellij.toolWindow.ToolWindowSetInitializerKt$computeToolWindowBeans$1.accept(ToolWindowSetInitializer.kt:278)
at com.intellij.toolWindow.ToolWindowSetInitializerKt$computeToolWindowBeans$1.accept(ToolWindowSetInitializer.kt)
at com.intellij.openapi.extensions.impl.ExtensionPointImpl.processWithPluginDescriptor(ExtensionPointImpl.java:301)
at com.intellij.toolWindow.ToolWindowSetInitializerKt.computeToolWindowBeans(ToolWindowSetInitializer.kt:274)
at com.intellij.toolWindow.ToolWindowSetInitializer$1.get(ToolWindowSetInitializer.kt:101)
at com.intellij.toolWindow.ToolWindowSetInitializer$1.get(ToolWindowSetInitializer.kt:83)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
at java.base/java.lang.Thread.run(Thread.java:829)
Any advice?
Best
Stapelüberläufer
I had the same problem after upgrading to Intellij 2022.1
For me, the fix came from Gen's answer. I also had an old Scala plugin, and just removed it as I'm not using it anymore.
If you are looking to upgrade it, go to File -> Settings -> Plugins. From there just hit Upgrade for the plugins you want. After that restart the IDE.
I found that Scala plugin was not updated and updating it to at least version 2022.1.13 fixed it for me.
I upgraded to Intellij 2022.1 and encountered this issue when trying to sync the old gradles projects that used to work for me :
Caused by: java.lang.NoClassDefFoundError: org/gradle/internal/impldep/com/google/common/collect/Lists
Cleaning the caches folder's content (Gradle_HOME/caches) resolved this issue for me
Make sure to also check that the SDK is correctly configured for your project (Java 17 by default) and the Gradle home is well specified in the Settings>Gradle section.
For info, I'm using Java 8 and Gradle 5.5.1 (yes I know :))
Just upgrade the Scala Plugin and its done!
visiting
scala plugin's page
and install it from there worked for me on ultimate version 2022.2.3

JVM Crash Problematic Frame: Canonicalizer::do_If

Iam facing JVM Crash cosistently while enabling hotdeploy (USING below java options on starting up JAVA_OPTS -Xmx4096m -XX:MetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=crash -XX:ThreadStackSize=512 -XX:+UseConcMarkSweepGC -XX:ParallelGCThreads=5 -XX:NewRatio=2 -XX:+UnlockDiagnosticVMOptions -XX:-UseLoopPredicate -Xdebug -Xrunjdwp:transport=dt_socket,address=$DEBUG_PORT,server=y,suspend=n -XX:NewRatio=2 -Dspringloaded.synchronize=true JAVA_OPTS=`echo $JAVA_OPTS -Dspringloaded.synchronize=true -javaagent:springloaded-1.2.1.jar -noverify
)
Environment : JDK 1.8 U 66, RHEL 6.7
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007faee9a1e27c, pid=27208, tid=140379827795712
#
# JRE version: Java(TM) SE Runtime Environment (8.0_66-b17) (build 1.8.0_66-b17)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.66-b17 mixed mode linux-amd64 )
# Problematic frame:
# V [libjvm.so+0x35027c] Canonicalizer::do_If(If*)+0x1c
#
# Core dump written. Default location: core.27208
#
# An error report file with more information is saved as:
# hs_err_pid27208.log
# [ timer expired, abort... ]
I've noticed both -javaagent and -noverify in Java options list.
It looks like springloaded agent generates invalid bytecode, while the bytecode verification is explicitly turned off. No surprise, this may lead to unpredictable results including JVM crash.
This is not a JVM problem, but most likely a bug in springloaded agent. Try to remove -noverify option.
-XX:-TieredCompilation may also work around this particular problem, but don't expect application to work correctly if the bytecode fails to pass verification. It's better to stay away from the buggy agent libraries.
4.2.1 Crash in HotSpot Compiler Thread or Compiled Code
If the fatal error log indicates that the crash occurred in a compiler
thread, then it is possible (but not always the case) that you have
encountered a compiler bug. Similarly, if the crash is in compiled
code then it is possible that the compiler has generated incorrect
code.
In the case of the HotSpot Client VM (-client option), the compiler
thread appears in the error log as CompilerThread0. With the HotSpot
Server VM there are multiple compiler threads and these appear in the
error log file as CompilerThread0, CompilerThread1, and AdapterThread.
Below is a fragment of an error log for a compiler bug that was
encountered and fixed during the development of J2SE 5.0. The log file
shows that the HotSpot Server VM is used and the crash occurred in
CompilerThread1. In addition, the log file shows that the Current
CompileTask was the compilation of the java.lang.Thread.setPriority
method.
An unexpected error has been detected by HotSpot Virtual Machine:
:
Java VM: Java HotSpot(TM) Server VM (1.5-internal-debug mixed mode) :
--------------- T H R E A D ---------------
Current thread (0x001e9350): JavaThread "CompilerThread1" daemon
[_thread_in_vm, id=20]
Stack: [0xb2500000,0xb2580000), sp=0xb257e500, free space=505k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code,
C=native code) V [libjvm.so+0xc3b13c] :
Current CompileTask: opto: 11 java.lang.Thread.setPriority(I)V
(53 bytes)
--------------- P R O C E S S ---------------
Java Threads: ( => current thread ) 0x00229930 JavaThread "Low
Memory Detector" daemon [_thread_blocked, id=21]
=>0x001e9350 JavaThread "CompilerThread1" daemon [_thread_in_vm, id=20] :
In this case there are two potential workarounds:
The brute force approach: change the configuration so that the application is run with the -client option to specify the HotSpot
Client VM.
Assume that the bug only occurs during the compilation of the setPriority method and exclude this method from compilation.
The first approach (to use the -client option) might be trivial to
configure in some environments. In others, it might be more difficult
if the configuration is complex or if the command line to configure
the VM is not readily accessible. In general, switching from the
HotSpot Server VM to the HotSpot Client VM also reduces the peak
performance of an application. Depending on the environment, this
might be acceptable until the actual issue is diagnosed and fixed.
The second approach (exclude the method from compilation) requires
creating the file .hotspot_compiler in the working directory of the
application. Below is an example of this file:
exclude java/lang/Thread setPriority
In general the format of this file is exclude CLASS METHOD, where
CLASS is the class (fully qualified with the package name) and METHOD
is the name of the method. Constructor methods are specified as
and static initializers are specified as .
Note - The .hotspot_compiler file is an unsupported interface. It is
documented here solely for the purposes of troubleshooting and finding
a temporary workaround.
Once the application is restarted, the compiler will not attempt to
compile any of the methods listed as excluded in the .hotspot_compiler
file. In some cases this can provide temporary relief until the root
cause of the crash is diagnosed and the bug is fixed.
In order to verify that the HotSpot VM correctly located and processed
the .hotspot_compiler file that is shown in the example above, look
for the following log information at runtime. Note that the file name
separator is a dot, not a slash.
Excluding compile: java.lang.Thread::setPriority
Source
Agree with #apangin, In the program you are doing bytecode intrumentation (-agent) but specifies -noverify. When verification is turned off, you may end up such crashes.
You should not use -noverify or -Xverify:none during byte code intrumentation.
For those of you unfamiliar with bytecode verification, it is simply part of the JVM's classloading process that checks the code for certain dangerous and disallowed behavior. You can (but shouldn't) disable this protection on many JVMs by adding -Xverify:none or -noverify to the Java command line. https://blogs.oracle.com/buck/entry/never_disable_bytecode_verification_in

Gradle exception Failed to load native library native-platform.dll

I have just installed Gradle 2.11 on a Windows 7 machine and when I run gradle -v I get a failure message. Gradle is in the path and the dll is present.
$ gradle -v --stacktrace
FAILURE: Build failed with an exception.
* What went wrong:
Failed to load native library 'native-platform.dll' for Windows 7 amd64.
* Try:
Run with --info or --debug option to get more log output.
* Exception is:
net.rubygrapefruit.platform.NativeException: Failed to load native library 'nati ve-platform.dll' for Windows 7 amd64.
at net.rubygrapefruit.platform.internal.NativeLibraryLoader.load(NativeL ibraryLoader.java:49)
at net.rubygrapefruit.platform.Native.init(Native.java:55)
at org.gradle.internal.nativeintegration.services.NativeServices.initial ize(NativeServices.java:74)
at org.gradle.internal.nativeintegration.services.NativeServices.initial ize(NativeServices.java:60)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute( CommandLineActionFactory.java:203)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute( CommandLineActionFactory.java:169)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionRep ortingAction.java:33)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionRep ortingAction.java:22)
at org.gradle.launcher.Main.doAction(Main.java:33)
at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBoots trap.java:54)
at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.j ava:35)
at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
Caused by: java.io.IOException: The system cannot find the path specified
at java.io.WinNTFileSystem.createFileExclusively(Native Method)
at java.io.File.createNewFile(File.java:1012)
at net.rubygrapefruit.platform.internal.NativeLibraryLocator.find(Native LibraryLocator.java:39)
at net.rubygrapefruit.platform.internal.NativeLibraryLoader.load(NativeL ibraryLoader.java:41)
... 16 more
This is cause by Windows configuration, probably through group policy. The file native-platform.dll is extracted from one of the JAR files, and probably placed in folder in the user home directory, such as c:\Users\%USERNAME%\Local Settings\Temp. For malware protection, loading of DLL's and execution of programs from TMP directories may be disabled.
I have a problem with the same symptoms, and I have been able to work around it in some cases by setting TEMP and TMP environment variables to point outside the user directory, such as c:\tmp. That has not been a universal solution and did not work for gradle. The location to which Gradle extracts DLL's can be overwritten by setting the GRADLE_OPTS to point to the desired location. This may work for you:
C:\ mkdir C:\tmp
C:\ set GRADLE_OPTS="-Dorg.gradle.native.dir=/tmp"
In adition, you have to put the set sentence in the gradle.bat located in the ../gradle-2.11/bin folder.
Example:
#rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%..
#rem agregado por marcgaso
set GRADLE_OPTS="-Dorg.gradle.native.dir=/tmp"
**strong text**
Further to user6823564 solution above, I also came across this issue after cleaning my temporary files.
The cause is a missing native folder. Beats me why Gradle just doesn't restore it like any other bit of missing temporary/cached data.
Answer:
md %GRADLE_USER_HOME%\native
Which is the default location. Or use the setting given by user6823564 and Marcos... using either
set GRADLE_OPTS="-Dorg.gradle.native.dir=%GRADLE_USER_HOME%\native"
or using
%GRADLE_USER_HOME%\gradle.properties
good luck.
1.Open the projects gradle.properties file in android studio
2.Added this line at end of file org.gradle.jvmargs=-Xmx1024m & Save the file
3.Close & reopen the project
And you just need to restart the android studio and your system. This is getting just because you have no enough free space in ROM

Sonar for Eclipse: unable to run local analysis

I have successfully installed sonar plug-in for eclipse, however when I try to 'Run Local Analysis' for sonar, eclipse gives an error saying:
An internal error occurred during: "Sonar Analysis".
Unable to create markers
and console for Sonar has following info printed:
Usage: javaw [-options] class [args...]
(to execute a class)
or javaw [-jar] [-options] jarfile [args...]
(to execute a jar file)
where options include:
-cp -classpath
set search path for application classes and resources
-D=
set a system property
-verbose[:class|gc|jni]
enable verbose output
-version print product version
-version:
require the specified version to run
-showversion print product version and continue
-jre-restrict-search | -no-jre-restrict-search
include/exclude user private JREs in the version search
-agentlib:[=]
load native agent library , e.g. -agentlib:hprof
see also, -agentlib:jdwp=help and -agentlib:hprof=help
-agentpath:[=]
load native agent library by full pathname
-javaagent:[=]
load Java programming language agent, see java.lang.instrument
-? -help print this help message
-X print help on non-standard options
-splash: show splash screen with specified image
-ea[:...|:]
-enableassertions[:...|:]
enable assertions
-da[:...|:]
-disableassertions[:...|:]
disable assertions
-esa | -enablesystemassertions
enable system assertions
-dsa | -disablesystemassertions
disable system assertions
Plz help with how to proceed for Local analysis in eclipse.
[Update: Version Details]
Eclipse: Indigo (3.7.1)
Sonar Plug-in: 3.0.0
Sonar(Server): 3.4.1
Sonar Web Service Client: 3.4.0
Java: 1.4.1 ('Java EE IDE' property in Eclipse Features)
Local Java Installation: 1.6