Error in Scala compiler: GC overhead limit exceeded - eclipse

I am trying to integrate Scala-2.10.4 along with Eclipse Luna 4.4.1 and getting into the following error.
Description Resource Path Location Type
Error in Scala compiler: GC overhead limit exceeded spark-core Unknown Scala Problem
I tried modifying memory limit on eclipse.ini.
--launcher.XXMaxPermSize
2048m
-XX:MaxPermSize=2048m
This still does not help. I have tried restarting eclipse and refreshing the project.
System details : MAC 10.8.5
EDIT :
I am trying to setup Spark codebase to work with Eclipse editor and following instructions from here : https://cwiki.apache.org/confluence/display/SPARK/Useful+Developer+Tools#UsefulDeveloperTools-IDESetup
I tried setting the compiler option on scala to -Xmx2048m and that does not work either. I am getting the following error

A few things:
You're setting MaxPermSize, when you probably need to set the max heap size. Use the "-Xmx2048m" command line switch to set the heap size to 2gb.
You're setting values into the eclipse executable, not the scala compiler executable.
Assuming you're using ScalaIDE, it seems you can add compiler parameters as follows. Under eclipse menu "Preferences", open "Scala" then "Compiler", then see the field labeled "Additional command line parameters".
I tried adding "-Xmx2048m" here, but the field indicates an error; I tried adding "-J-Xmx2048m" and no error is indicated, so perhaps that will work for you.

Try checking the maven dependencies, In my case the missing jars was causing the compiler to through this error. I had to fix delete the missing links from the .m2 repository and and then update the project to re-download the dependencies. This resolved the issue and the error stopped appearing. Learning from JimN's explanation, switching on the verbose would give us better clue of what is causing the fault. Though this is not a straight fix to the issue mentioned. I believe the actual error is masked and over-consuming the heap causing eclipse to throw the GC overhead limit exceed error. Post back your observations so that it would be helpful.

Under eclipse menu "Preferences" > "Scala" > "Compiler", then in "Additional command line parameters" add "-J-Xmx2048m" or "-J-Xmx1024m"
Restart eclipse or refresh the project it should be fixed.

Related

Eclipse: false error with jdk7

I've been having a problem with eclipse that's been stressing me a lot. Whenever I start a new Java porject, everything goes smoothly and perfect, until I "clean" the project (Project -> Clean...) and everything goes to ##~%&...
I keep getting:
XYZ cannot be resolved to a type
Multi-catch parameters are not allowed for source level below 1.7
<> operator is not allowed for source level below 1.7
That's very nice, only that I am importing all required classes and I do have 1.7 since the begginig. It's the only version I've installed. I've already tried this and other similar responses for the last few days with no avail.
A solution was to create a new project, copy and paste all packages/clases, which worked for a while, but I added UMLet to the project and again... Removing UMLet plugin did nothing for me.
BTW, even with the "errors", my project runs without any problem, therefore I know they're not real. I could keep working, but then, I can't see when a real error arises...
Does anyone got a final solution to get rid of this false errors?
EDIT:
I forgot to mention that I'm working with Kepler.
EDIT 2:
Here are screen captures with the requested information.
You can solve this by setting up correct JRE environment in Eclipse as below.
Go to Project => Properties => Java Build Path
Click on Libraries
Select JRE System Library
Click on Edit button at right hand side
Set Execution Environment to Jave SE-1.7(jre7)
Clean project or refresh project.
A solution was to create a new project, copy and paste all packages/clases, which worked for a while, but I added UMLet to the project and again...
One possibility is that the UMLet plugin is the cause of your problems. Try a clean Eclipse install without UMLet. (The fact that uninstalling the UMLet plugin didn't fix the problem is in no way conclusive.)
Note that UMLet will run as a stand-alone tool.
BTW, even with the "errors", my project runs without any problem, therefore I know they're not real.
The likely explanation for that is that the compilation errors come from the incremental Java compiler that is built into Eclipse. A different compiler (i.e. the one from your installed / configured JDK) is used to generate the ".class" files.
Multi-catch parameters are not allowed for source level below 1.7
not a solution, to this issue, but if you want to have two exceptions you can code it like this:
try {
// code here
} catch {
// code here
} catch {
// code here
}
it worked for me, instead of having catch (exception1 | exception2 e)

Debugger source line synchronization not working in IntelliJ IDEA Scala plugin

I'm running IntelliJ IDEA 12.1.3 on Windows 8 with the Scala plugin 0.7.264. Scala is installed in C:\Apps\Scala\scala-2.10.1, and that directory is in my PATH. The Scala docs are in C:\Apps\Scala\scala-2.10.1\doc\scala-devel-docs\api. These are manual installs from the .zip files.
Everything seems to work fine except for two things:
First, if the "Run compile server (in external build mode)" settings is enabled (as it is by default), I get this error:
Turning off that setting fixes that for now, but there is another problem. I can run my code in the debugger and see values change in the debugger panel as I single step through the code, but it doesn't synchronize the source file view as I step through.
Normally I'd expect to see the current line being executed turn green, and the green highlight would follow along as I hit F10 or F11 to step through, but it doesn't. I can set breakpoints on source lines and let it run, and it stops at each breakpoint as expected. It just doesn't highlight the source line in green when it gets there.
Similarly, if a source file is not open (either my source code or a library file), and I step into that code, it appears to single-step correctly but does not open the source file at all.
Everything else works fine, like the autocompletes and Shift+F1 to view the Scala docs for the name the cursor is on.
The really odd thing is I had full debugging working briefly. At first I'd installed Scala from the .msi file, so it installed Scala into C:\Program Files (x86)\scala. When I set up IntelliJ to use that Scala installation I did get the green highlight on source lines as I stepped through the code.
The only problem with that setup was that IntelliJ complained about the missing doc\scala-devel-docs\api directory when I'd setup a Scala project, because the .msi installation uses a different subdirectory for the API docs. It was easy enough to fix that up manually in the Global Liraries settings, but I figured I'd try the .zip installation so I could use a directory layout more like what IntelliJ was expecting.
I should have left well enough alone! I even tried going back to that arrangement and still didn't get source line synchronization working again.
At one point I also tried letting IntelliJ do the Scala installation, but that also gave the same results: everything working except source line synchronization in the debugger.
There must be some obvious thing I got wrong, but I'm not sure what it could be. Does anyone have any ideas?
Here's a screenshot from a debug session:
The program is stopped on line 3, as indicated by the values assigned to x and y but not yet to z, and the <init>():3, Main$$anon$1 in the Frames panel. So line 3 should be highlighted in green but isn't.
Here are the relevant settings dialogs:
The above is with "Run compile server" on; as mentioned I ended up turning that setting off. The field values are the defaults, including the -server -Xss1m -XX:MaxPermSize=256m JVM parameters.
I am using the same version of IDEA and the Scala plugin (however on OS X and JDK 6), and I do not have this problem. Does this occur with any of your projects or only a specific one?
Assuming that the OS shouldn't be responsible, the difference is that I use sbt to build my projects. So if you are willing to set up a build.sbt and installing the SBT plugin for IDEA, this might be worth a try.
Although the fancy new compile server should in theory be as fast and smooth as sbt, I find it very pleasant to work with the sbt plugin. You can install it from Settings -> IDE Settings -> Plugins. Next step I also highly recommend is to use the sbt-idea plugin, which is like the complementary to the IDEA SBT plugin—this will allow you to generate the full IDEA project files from sbt (you can have as little as a single scalaVersion entry in build.sbt if you don't need to manage dependencies, so you don't need to learn much of sbt in the first place).
The final step then is to go into your Run/Debug configuration, and change in the "Before launch" section from "Make" to "SBT".
Finally you might get better support for your problem through the JetBrains online forum.

Eclipse internal error while initializing Java tooling

I am getting errors from Eclipse Indigo running on Windows 7 Ultimate. For each of the following items:
Android SDK content loader
Building workspace
Initializing Java Tooling
Loading data for Android 2.3.3
Loading data for Android 4.03
this error is thrown:
An internal error occurred during: "Initializing Java Tooling".java.lang.NullPointerException
What should I do?
Delete your existing workspace and then recreate the workspace and add your projects.
Just change the following values at "eclipse.ini" file to the following:
-Xms1024m
-Xmx2048m
Note:
You can find the "eclipse.ini" file by right click eclipse icon on and select "Open file location".
This error occurs because the eclipse is running out of memory, so we just increased the assigned memory for the eclipse application.
Close Eclipse.
Go to workspace folder in windows explorer and delete following folders:
.metadata
.recommenders
RemoteSystemsTempFiles
Servers
Open Eclipse and provide the same workspace folder again during launch.
I would just like to add, that simply closing and reopening eclipse has always worked for me with this type of error.
NO Need to create another work-space and import all the projects from the older one : Just empty \Workspaces\MyEclipse 8.5 M2\.metadata\.plugins\org.eclipse.core.resources\.projects directory and restart myeclipse/eclipse
I faced the same issue.
But changing two configuration in eclipse.ini resolved my issue.
-Xms512m to -Xms1024m and
-Xmx1024m to -Xmx2048m
Check your Project -> Properties -> Java Build Path has JDK Library instead of JRE System Library.
Go to Eclipse installed directory, Search eclipse.ini -> Open it
Search lines for containing any below values:
-Xms512m
-Xmx512m
-Xms1024m
-Xmx1024m
-Xms1G
-Xmx1G
Just double it the memory size, Assume you have to change the
-Xms512m to -Xms1024m
Increasing the eclipse memory size will help eclipse to gain more RAM size from your PC.
In my case, I restarted my eclipse IDE without deleting/editing my workspace or .metadata folder. Error "An internal error occurred during: "Initializing Java Tooling". java.lang.NullPointerException" is gone and Eclipse just working good.
Sometimes the issue is with the version of the Java installed. I was facing a similar issue when trying to start Spring Tool Suite on my Ubuntu 16.04. I had java 9 installed on my machine. I changed it to java 8. And it started working.
My issue was caused by some old Java projects using an old JRE System Library, so all I had to do was remove the old library and add the new one by right clicking the project -> Properties -> Java Build Path -> Libraries -> Add Library.
I was facing the same issue in eclipse so I am telling you the same step that I did
you just need to go eclipse installed folder where you will find the file named eclipse.ini
in my case the location was
C:\Users\comp\eclipse\jee-2018-12\eclipse
you can find your location.
in that location, open eclipse.ini in text mode and there you will find some below text
-Xms256m
-Xmx1024m
change it to
-Xms512m
-Xmx1024m
I hope that will help you 100% as checked in my System ;-)
Just delete the .metadata on workspace, and restart IDE and configure it again properly
My problem too got fixed which i was getting on STS, just closed all the project's including the server on the project explorer, restarted ide, that's it.
check the Eclipse log (the intelligently named ".log" file in your workspace .metadata folder) and check for the complete stacktrace. In my case it was
caused at method "org.eclipse.m2e.jdt.internal.MavenClasspathVariableInitializer.initialize(MavenClasspathVariableInitializer.java:30)" which lead to a never fixed "race condition during startup" bug.
I would really recommend dumping Eclipse in favor of a more serious IDE; like IntelliJ or Netbeans. Using Eclipse means that you will invest 40-50% of your time trying to work around this kind of bugs, instead of being productive.
Just close the Eclipse or STS and restart it again. This may fix this error.
I faced the same issue. Switching back to the predefined work-space from the Switch workspace option in eclipse solved my issue.
In my case "MySQL service" is disabled. And I got same error.
So if you are using MySQL then check for it.
Press win+R then write services.msc and hit enter. Search for MySQL service. Start the service.
In my case, I had two of three projects with this problem in my current workspace. I opened workspace catalog and made a backup of corrupted projects, deleted them afterwards. Then opened eclipse once again. Obviously there was missing data to work with. Closed eclipse once again and added back earlier saved projects without metadata catalogs.
TL;DR. Just remove metadata catalogs from projects in your workspace.
In my case, Eclipse tried to launch with non-existing workspace folder. Sure the folder is created at the moment, but the exception is occured durring creating the workspace. After the exception I just switched workspace to the right folder. To avoid slipping to non-existing workspace folder I deleted it from Recent workspaces.
In my case even after deleting the workspace and reimport doesn't work. Because all the files are Corrupted. so have utilized my existing backup data, extracted it & reimported into workspace then it started working fine.
Upgrading Eclipse to the latest version (2020-12, 4.18.0) fixed the bug for me.
Instead of deleleting the workspace & losing the code, try uninstalling the AWS toolkit and then just reinstall it. By going in:
Help > Market Place > search for AWS toolkit > click install button > click change button > uninstall.
Do the same for reinstalling & restart the Eclipse IDE so that it will configure by itself.

problem in linking viewer selection with current editor - Eclipse

I often get this error "Operation linking viewer selection with current editor finished with errors" in Eclipse Galileo.
Once this error pops up no UI events is working in the IDE , i cant even able to close it also. Every time i have to go to task manager to stop the process , after this IDE works fine for some 5 min and again it display the same error as mentioned above.
i don't know what is happening , can you guys please help.
Just switch your Project Explorer to the Flat package presentation in Eclipse. It works :)
see details here: https://bugs.eclipse.org/bugs/show_bug.cgi?id=530450#c7
Per the Eclipse manual:
PermGen is the permanent generation of objects in the VM (Class names, internalized strings, objects that will never get garbage-collected). An easy, if somewhat memory-hungry fix is to enlarge the maximum space for these objects by adding
-XX:MaxPermSize=128M
as an argument to the JVM when starting Eclipse. The recommended way to do this is via your eclipse.ini file.
If you are getting OutOfMemoryErrors while running Eclipse, the VM can be told to let the heap grow to a larger amount by passing the -vmargs command to the Eclipse launcher.
-vmargs
-Xms512m
-Xmx1024m
Alternatively, you can invoke the Eclipse executable with command-line arguments directly, as in
eclipse [normal arguments] -vmargs -XX:PermSize=512M -XX:MaxPermSize=1024M -Xmx1024M [more VM args]
Even with recent versions of Eclipse and Flat Package presentation, if you have a lot of large projects loaded this can still be a problem.
I've found however that if you break up your projects into working sets and minimise the amount of projects/tree nodes open by selecting a working set it can really speed up Eclipse and mitigate this problem.
I had this problem (Version: Photon Release (4.8.0)) and I fixed it by removing all breakpoints.

JVM terminated. Exit code = -1

I've been using Eclipse for some time already, and I didn't have any problems with it. However, when I tried to generate some javadoc, I found that I didn't have the SDK installed. I installed jdk 6u23, and from then on, Eclipse hasn't been working.
At first it told me it couldn't find a JRE/SDK. After copying and placing the JRE in the Eclipse folder, the error changed to this:
I've searched around for some solutions, and found a few of varying nature. However, none of them seemed to work.
I've tried emptying my eclipse.ini file without success.
Altering some values in eclipse.ini didn't work either.
Installing Java SDK 1.5 didn't work.
Does anyone have other possible solutions?
Update: I tried reinstalling Eclipse, but it didn't fix the problem. I did notice that it's a 32bit version, while I'm running a 64bit system. However, if this were to be the problem, I find it strange that it hasn't been an issue earlier.
Update 2 I've reinstalled both Eclipse and Java once more, and everything works again.
Remove the default value "256m/256M" from the eclipse configuration file (eclipse.ini).
You will find this line just below "--launcher.XXMaxPermSize".
Edit your Environment Variables >> System Variables >> Path to
C:\Program Files (x86)\Java\jdk1.6.0_24\bin;
(NOT C:\Program Files\Java\jdk1.7.0_01\bin;)
it should work
If you have got a problem like that, you should change the path of jre.
Firstly, computer> properties > advance system setting > Environment variables > find "path" under system variables then give the directory of your jre/bin. (for example C:\ Program Files\ java\ jre\ bin)
Perhaps you should reinstall Eclipse. Then you can add the JDK through Windows -> Preferences -> Java -> Installed JREs.
I had similar issue:
Eclipse IDE fail to launch with JVM Terminated. Exit code=-1
One thing that worked for me is to set -Xmx to 256m in eclipse.ini. If that is not good enough for you, you may also try using different JVM module than the one that eclipse uses by default.
If you look in the error dialog in your screen capture, you'll notice that the "-vm" option using "jvm.dll" as JVM. If you change it to use javaw.exe in your JAVA_HOME\bin folder, the problem should go away.
I'm still clueless as to what the difference is between using jvm.dll vs javaw.exe. Maybe jvm.dll is suppose to be used only for light-weight embedded java applet and it can't handle the load brought on by a full stand-alone Java UI software.
I just had the same problem on Windows 7, 64 bit. I reinstalled Java 32 and Java 64, and Eclipse, but it did not fix the problem. I found that in eclipse.ini the Dosgi.requiredJavaVersion was 1.5, so I changed it to Dosgi.requiredJavaVersion=1.6.0_25. In the Environmental variables I added to the PATH %JAVA_HOME%\bin;C:\Program Files (x86)\Java\jdk1.6.0_25\bin.
These changes fixed my Eclipse problem.
In my case the cause was a corrupted eclipse.ini file. I had been editing the file, and accidentally changed -Xmx512m to -Xmx512
First Approach:
I added below lines in eclipse.ini
-vm C:\Program Files(x86)\Java\jre\bin\java.exe
Modified below line in eclipse.ini (changed to 1.6.0_37 from 1.5),
-Dosgi.requiredJavaVersion=1.6.0_37
Deleted JAVA_HOME from environment variables which was pointing to c:\jdk1.6
Now Eclipse is working fine.
Second Approach:
Another way - don't add below line in Eclipse and only modify JAVA_HOME to point to C:\Program Files(x86)\Java\jre,
-vm C:\Program Files(x86)\Java\jre\bin\java.exe
Eclipse should work now.
I added the entry in the Path environment variable to the jdk bin folder and it started working
Path = %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\Microsoft Application Virtualization Client;C:\Program Files\Java\jdk1.6.0_18\bin
There could be many possible causes for this error. It could be that compatible mode is not selected in windows 7 , path or eclipse.ini problem.
Please add "-vm" option to the eclipse.ini file available in the same folder as eclipse.exe.
The -vm option should point to the javaw.exe located in your machine, something like the below.
-vm C:\Program Files(x86)\Java\jre\bin\jawa.exe
After adding the above line to eclipse.ini save it. Now clicking eclipse.exe will automatically launch the IDE.
I had the same problem and it turned out to be a problem with 64-bit versions. My solution was removing all my Java programs and reinstalling the 64-bit JRE (I had downloaded the 64-bit Eclipse).
I tried all the solution still didnt find my luck.Lastly i got it resolved by pointing to client jvm.dll in eclipse.ini file
-vm
C:\jdk160_05\jre\bin\client\jvm.dll
I made a series of trials which you may find useful if you face the same and not getting resolved yet
exit-code-1
I resolved it by installing 32 bit JDK and editing eclipse.ini to point to 32 bit jdk . Added -vm C:\Program Files (x86)\Java\jdk1.7.0_71\bin at the end of eclipse.ini file.
Note: I have my JAVA_HOME pointint to 64 bit JDK
There is no need for reinstalling eclipse IDE or changing your environment variables. I had encountered this problem while working on my project I had this issue but I fixed it in no time and it works fine for me.
Before implementing any solution, Check first that you don't have multiple installations of JDK in your system. I have encountered many systems with JDK 1.7 and JDK 1.8. If it is so, simply change your -vm to the alternate jdk
C:\Program Files\Java\jdk1.7.0_60(jdk version you were not using)\jre\bin\client\jvm.dll
and start your eclipse IDE. IT will work but the workspace will not synchronized and the files will not be getting displayed. Just close your IDE and revert to your previous jdk link and Voila It works.
In case you have a single JDK installed in your system. I suggest clearing your CPU Physical memory. It so happens JVM has issues in execution if a lot of memory is utilised. Just go to the Task manager and close any redundant processes.
Hope this helps! Keep Coding :)
I added the new JRE to the eclipse.ini file and updated my PATH. Seemed to work for me.
I had encountered the same type of the popup message when i am opening IDT app in SAP. It has been resolved after reduced below value
Option Name: _JAVA_OPTIONS
value: -Xms512M -Xmx1024M ( Previously -Xmx2048)
If you encounter a problem like this you can get a little more information by using eclipsec.exe from a command-line instead of eclipse.exe. I got this additional info in the dos box:
C:\<...>\Eclipse>eclipsec
Error occurred during initialization of VM
Could not reserve enough space for object heap
So I lowered my -Xmx setting in eclipse.ini from 1024 to 768, which made it work again.
Why this was suddenly necessary I do not know atm, Eclipse has been running fine with 1024m some days ago.
I am able to solve same issue by specify the -vm
C:\Program Files\Java\jdk1.6.0_45\bin\javaw.exe in eclipse.ini.
I have the same error. It might be because your PC was forced to shut down at night.
My solution was go to the path C:\Users\<find your user profile>\AppData\Local\javasharedresources and delete the file inside this folder
You just click on startup on eclipse folder and open the eclipce or right click on startup and click open with last javaw, then you can find solution.
This problem occure in the case, when you are using 64 bit OS on 32 bit motherboard.
Now, it can be resolved easly,
First uninstall 64 bit java and install 32 bit java.
and set environment variable with jdk path.