problem in linking viewer selection with current editor - Eclipse - 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.

Related

Error in Scala compiler: GC overhead limit exceeded

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.

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.

Eclipse Performance Maintenance

Is there a cache or something that needs be cleared periodically?
Eclipse has been running pretty badly lately, especially with regards to open files and switching between them in the editor.
Frustrated and confused.
There is nothing that you as a user need to run periodically to keep Eclipse performing. I would guess that you are seeing performance problems due to Eclipse process hitting its allowed memory ceiling. Take a look at your eclipse.ini file and update the -Xmx setting. Don't crank it up too high as that can keep your Eclipse from starting.
You can delete old configurations. This might speed up start-up time, but I'm not sure. Ignore the revert highlight on the image. What you need is the delete button that appears in later versions of Eclipse next to it. Delete everything but the current installation configuration.
To access, go to Help > About Eclipse SDK > [Installation Details] > Installation History.
Also, make sure you have projects other than the one you're working on closed. Doing this reduces the size of the in-memory Eclipse workspace model.
Also make sure projects that you are running are shutting down correctly (or manually terminate them). I have found times that a project I was testing did not end after an error and I had 10 instances of it running in Eclipse, I had to select the console and manually end it. (Closing and opening Eclipse also frees things like this up).
You can give more memory to it , modifying eclipse.ini file. For example:
-vmargs
-Xms384m
-Xmx768m
default ones 256-512m.
Look here for optimal JVM settings when running eclipse
Sometimes if you've had the workspace for a very long time eclipse would run slower, delete the old workspace and then create a new one, importing the project into it again (Make sure to check in or backup your code first).
I wouldn't really recommend tampering with the eclipse JRE runtime parameters. But if you are at liberty to update eclipse, I would recommend you update it to the latest version.
I've added some tips that could help improve the performance of eclipse in an answer to a question.

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.

How to make the eclipse IDE to build faster

I am using Eclipse for development. However, it's is taking too much time to build.
It hangs when the percentage of build gets to 78. It shows "refreshing workspace" several times. That eats up lots of time.
How can I make Eclipse faster?
Increase the start-up memory as mentioned by thamaria
Disable spell check of eclipse
Disable the plugins which you never use it (myln etc)
Disable auto build.
This link might help you
http://pakkatechies.blogspot.com/2011/07/making-eclipse-ide-faster.html
There are many possibilities to tune Eclipse.
First, when Eclipse is hanging up you should start Eclipse with some arguments and give it more memory. Use: eclipse -vmargs -Xms256m -Xmx1024m or even more.
EDIT: "eclipse -vmargs -Xms256m -Xmx1024m" is the commandline command with which you can start Eclipse (well, depending on your OS). For that you either need to have eclipse in your environement path or you will have to use an absolute path to your eclipse executable file. Under Windows systems you may use for example "C:\Programme\eclipse\eclipse.exe -vmargs -Xms256m -Xmx1024m". You could f.e. create a short-cut with this command.
Second: If possible you can use several workspaces for your eclipse projects if they are not connected to each other. When using other projects than the ones located in your actual workspace switch the workspace to the one you desire. That way eclipse does not need to load all contents at startup and will therefor start much faster.
Third: You can disable the "build workspace" Option. Go to "project" --> and uncheck "build automatically".
In the project build properties, under behavior tag, check the 'Enable parallel build' box.