Eclipse Spring Boot Build Path Contains Duplicate Entry - eclipse

I have been using Eclipse Luna and sprint boot for quite a while. Just today, when I created a new project I am getting the following build error,
Build path contains duplicate entry: 'org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8' for project 'TomcatHttpDemo'
I am not sure if this is related to this problem but I tried
properties> Java Build Path > Libraries
and found that 'JRE System Library[JavaSE-1.8] was listed twice. I deleted one of them and then cleaned and re-built the project. I got a bunch of new errors. These errors were all related to deleting the JRE system library. I even restarted Eclipse several times to clear out any lingering errors.
I was running Luna 4.4 and upgraded to Mars 4.5 but the problem continues to persist. I can build my old projects with no problems at all. Using Luna or Mars the old projects build and execute properly. Any time I try to create a new project I get the duplicate entry error. Any help would be appreciated.

if i understand your problem it's library issue with your project so
1.Select your project then go to Properties
2.Java build Path
3.in the Top select Libraires
4.add a JRE System Library
5.check the Execution Environment Then Click to Environments
6.On the left click to Installed JREs
7.Then Click To add , Standard VM
8.click To directory Then go to /yourprograms/java/jdk 1.8
9.then Click finish after this check what you just added and click ok
10.when everything is closed update your maven Project
i hope it helps you

Related

NetBeans background scanning projects takes too long

NetBeans background scanning projects takes too long. Every time when I open netbeans it scanning for ages. I used NetBeans 7.2 and it works perfecly. Now I formatted pc and reinstalled windows, install the same version of NetBeans 7.2, and it works to slow.
Having the same issue with 8.0.2 when a project has JS resources I tracked it down in my case to a problem with the javascript2 editor module which has been updated over the original version shipping with netbeans 8.0.2.
I simply solved it by removing the updated module.
On Linux:
rm ~/.netbeans/8.0.2/modules/org-netbeans-modules-javascript2-editor.jar
However, after letting the netbeans updater download the module a second time, the problem didn't appear again.
In Netbeans 8.1, the location of this file is at:
ide/modules/org-netbeans-modules-javascript2-editor.jar.
I have the same problem in netbeans but i found solution by unselect
the check from auto scan background
in your netbeans IDE go to tools and then Option and select then to miscellaneous and select file tab inside miscellaneous and
you will find check as "enable of auto-scanning of the source
unselect that one and netbeans will be fast then i hope it will help you
in fasting your IDE too
After latest update of Netbean 8.0.2 I have the same problem that scaning process did not stop and go forever with CPU usage on 25%.
When I replace javascrip editor files in C:\Program Files\NetBeans 8.0.2\ide\modules on Windows 7 with old one then scaning project process start work again. You can take those file from this repo.
i'm facing the same issue, but it works fine after increase the heap size by adding -J-Xmx2048m in <NETBEANS_DIR>\etc\netbeans.conf
mine looks like this:
netbeans_default_options="-J-client -J-Xss2m -J-Xms2048m -J-Xmx2048m -J-XX:PermSize=32m ......
Try the following :
1) Go to Window-->Files. This opens the Files Tab.
2) In the Files Tab for each opened project open the nbproject folder and inside it open the project.properties file.
3) Now in this file below the property "excludes" there are file references listed for all your referred Libraries (JARs)
4) There might be some repeated file references with paths that may be old or on someone else's machine(if you are working in a group and transferred projects from someone's machine)
5) Delete those old path references.
Example -
excludes=
file.reference.xyz.jar=../not/correct/path.jar //delete this line
file.reference.xyz.jar-1=../correct/path.jar //remove -1
....
includes=**
6)Also locate the property "javac.classpath" and delete the unnecessary classpath entries corresponding to the deleted references as described above.
Example -
javac.classpath=\
${file.reference.xyz.jar}:\ //keep this line
${file.reference.xyz.jar-1}:\ //delete this line
....
javac.compilerargs=
7) So now the file reference mentioned in the file reference section and the javac.classpath property is same and points to a valid Library (JAR) address on your machine or network.
Example -
excludes=
file.reference.xyz.jar=../correct/path.jar //the correct reference & path
....
includes=**
....
javac.classpath=\
${file.reference.xyz.jar}:\ //the correct classpath entry for reference
....
javac.compilerargs=
....
The reason the above procedure worked (in my case) is because it prevents Netbeans from scanning unnecessary Library paths that may not be present on your machine/network.
On Windows 10 64bit I had the same problem with Netbeans IDE 8.1
I restarted Netbeans as administrator and the problem was solved. Then I closed Netbeans and started normally and the problem was still gone.
Product Version: NetBeans IDE 8.1 (Build 201510222201)
Updates: NetBeans IDE is updated to version NetBeans 8.1 Patch 1
Java: 1.8.0_60; Java HotSpot(TM) 64-Bit Server VM 25.60-b23
Runtime: Java(TM) SE Runtime Environment 1.8.0_60-b27
System: Windows 10 version 10.0 running on amd64; Cp1252; nl_NL (nb)
OS: Windows 7 x64.
The following worked for me:
I fully uninstalled Netbeans (ticked all boxes in uninstaller). For those who couldn't you'll need to go to C:\Users\%username%\AppData\Roaming\NetBeans\8.0.2 and delete a file called 'lock'. This is normally removed when the program exits but if you need to force terminate it'll remain there.
After that I uninstalled JDK and JRE then downloaded Java Platform (JDK) 8u40:
http://www.oracle.com/technetwork/java/javase/downloads/index.html
And Netbeans 8.0.2:
https://netbeans.org/downloads/
Installed JDK (which installs JRE too), after that Netbeans. Once complete I loaded up projects where background scanning got stuck and it seems to have fixed it. Will post updates if it starts happening again.
I actually made a bug report for this issue. It was fixed and pushed to the update channels yesterday. So for anyone still having this specific bug, let Netbeans check for updates. :)
Bugfix: https://netbeans.org/bugzilla/show_bug.cgi?id=250985
On Ubuntu 18.04 / Netbeans 10.0, I had the same problem.
[FAIL] Deleted cache
[FAIL] Deleted project-specific "nbproject" dir
[FAIL] Closed the offending project (mouseover the progress bar to identify which one) --> restart NB --> create new project
[SUCCESS] Nuked the project from the F/S --> re-cloned --> restarted NB. I also renamed the directory itself, in case there was some other cache that pointed to the old dirname.
Please try NetBeans 8.0.2 from https://netbeans.org/downloads/
NetBeans 7.2 is too old and you will not get any support anymore.
I was having the same problem with Netbeans 8.1, Windows 10. It was also hanging when I tried to compile and refactor. It would sometimes say 100% done yet continue background scanning for hours. I closed the project in which this was happening, and switched to a simple project and the problem went away. So I examined my code. I had class A extending class B, then class B importing class A. When I changed this, the endless looping in Ant stopped.
Always I fix such Netbeans related problems by deleting cache directory.
Directory location can be seen on About dialog window.
For me, the path is
C:\Users\USER\AppData\Local\NetBeans\Cache\YOUR_VERSION
This problem is related to one of the project opened in your IDE. As I had been facing the same issue but, after spending two hours on that issue I finally fixed that. Close project one by one or check and close the project where background processing is taking time. After closing the project delete the .nbproject folder and re-import the same project into your IDE.
It should be called foreground scanning of projects. Closing the program and restarting solves it for me sometimes.
I had the same problem but in my case I was on Windows 10 and running NetBeans 8.1.
Before I formatted my laptop I copied and backed up C:\Users\user_name\AppData\Roaming\NetBeans\8.1 and C:\Users\user_name\AppData\Local\NetBeans\Cache folders
Then i followed the below steps:
Install NetBeans and run it.
Closed NetBeans
Go to C:\Users\user_name\AppData\Roaming\NetBeans\8.1 and C:\Users\user_name\AppData\Local\NetBeans\Cache folders and replace them with the backed up folders.
Run NetBeans again
I hope this solves your problem!!
In my Laravel case ,got this "forever scanning" because the project was created in another IDE. I put the old IDE related folders .idea , vendor , node_modules into myproject->Properties->Ignored folders . Relaunched NetBeans as admin. It will scan a little bit but next time wont stick on that.

plug-in org.eclipse.m2e.core.ui was unable to load class

I had made an maven project and it worked fine.
Then I installed plugins
EclEmma Java Code Coverage,
PHP Development Tools (PDT),
Eclipse.orgSonarQube
Then I worked on some other project. When I again wanted to create an maven project,it threw the following error window which said
The selected wizard could not be started
reason
plug-in org.eclipse.m2e.core.ui was unable to load class
org.eclipse.m2e.core.ui.internal wizards.MavenProjectWizard
Removed SonarQube plugin .This solved the issue.
Now it works all fine.
But is there any other solution to this problem since I have to use sonar.
Click on eclipse help tab and open installation details search sonar and remove all related plugins.
That's not quite the right characterization of what it says on the page,Please check your .log file /path/workspace/.metadata/
Find the correct plugin which is causing this problem and update to compatible version of the plugin with eclipse version.
To find the hidden files in the workspace use Ctrl+H
I had the same problem, and I've tried so many solutions. But what I did to solve the problem, is that I just upgraded my Eclipse IDE (2019-06 to 2020-03) by following these steps (from https://wiki.eclipse.org/FAQ_How_do_I_upgrade_Eclipse_IDE%3F) :
You first need to add the new release's repository as follows:
1-1. Window > Preferences > Install/Update > Available Software Sites
1-2. Click 'Add'
1-3. Enter the URL https://download.eclipse.org/releases/2020-03/
1-4. Click 'Ok'
Help > Check for Updates
If updates are found, proceed through the install wizard and restart the IDE when
prompted. Otherwise, read carefully the error message to find out which component
is conflicting and establish your resolution strategy.
Note that the start splash screen may be cached and will not necessarily be
updated to the latest version after the IDE is restarted. Performing a full
relaunch should display the new version number.

Eclipse Crash "java was started but returned exit code = -805306369"

I'm aware there is an identical post here but none of the proposed solutions have changed anything and they are quite old (problems to do with Java6) and seem to be referring to a bug to do with Eclipse.
My problem is when I am developing in Eclipse for RCP and RAP Developers; either making changes to java files or changing dependencies etc, Eclipse randomly hangs and then freezes. I have to force close eclipse and I get this message
Things I have tried so far:
Restarted eclipse and PC
Added the -clean command to the very beginning of the eclipse.ini file
Created a brand new work space and attempted to develop in that
I'm running on the latest version of Java (1.7.0_13) and haven't got a clue what to do next.
The problem has happened 4 or 5 times in a number of different occasions:
When I have tried to add a new package to the src folder
When I have tried to add a class to a package in the src folder
When I have tried to edit a class in a package in the src folder
When using Ctrl+Space in a class in the src folder
Any advice/tips would be greatly appreciated! Need to get this problem sorted so I can get developing for my 3rd Year University Project :)
java was started but returned exit code = -805306369
is caused by Eclipse´s corrupted workspace, I solved my problem with these 3 steps:
1) Go to your workspace and rename it.
2) Start your eclipse and by default it will create a workspace.
3) Go to File -> Switch Workspace, choose your original workspace.
After a lot of researching and filing bug reports to no avail I tried one last clear out of Java and fresh installs of Eclipse to try and fix the error and it seems to have worked.
Here is what I did:
Un-installed Eclipse for RCP and RAP developers
Un-installed Java from my PC and deleted any old Java folders that were left behind (I didn't do this in previous clear outs so maybe there was an old version of Java messing something up)
Did a fresh install of Eclipse for RCP and RAP developers and a fresh install of the latest Java
I also deleted my old PATH variable for Java in Environment Variables and put the new one at the front of all the other entries
This seems to have fixed the error for now so hopefully it won't be a short term fix
I opened another instance of eclipse and it prompted me to choose a new workspace. I did so and there it was resolved. Then I closed the new workspace and resorted back to old workspace as usual.
If using Maven projects, check pom.xml, this may corrupted. Mine resolved by fixing pom file.
java was started but returned exit code = -805306369 caused by Eclipse´s currupted workspace, I solved my problem with this 4 steps:
Close Eclipse.
Kill the adb from task manager.
Start Eclipse and by default it will create a workspace or start with new workspace.
Go to File -> Switch Workspace, choose your original workspace.

Eclipse - An internal error occurred during: "Compute launch button tooltip"

I launched Eclipse earlier to jot down a snippet and was faced with the following as an error when I tried to run a fresh project:
An internal error occurred during: "Compute launch button tooltip".
That popup window shows as soon as I mouse-over the run icon in the top bar, or if I right click on the class in the explorer window and select any of the run/debug options.
After doing some research on the error, I see several people who posted similar messages but they all have been fresh installs of Eclipse. So note that this is not a fresh install, and that Eclipse was working fine earlier today. Also note that not only does my new project not run (with the normal main method), but projects I was running earlier have all stopped working with the same error.
Finally, also be aware that after seeing other people's suggestions on fixing this, one specifically said to select run configurations from the top of the page run menu. When I selected run configurations from this dropdown, I got the following message:
Exception occurred creating launch configuration tabs
Reason: Plug-in org.eclipse.jdt.debug.ui was unable to load class org.eclipse.jdt.internal.debug.ui.launcher.LocalJavaApplicationTabGroup
After that message, the run window opens but all of the tabs are missing. Like where you can set the display width and height, and the other tabs, they are all missing from the window now.
I was using Eclipse trouble free earlier today and I am sure no updates took place between when Eclipse was working and now. My question is of multiple parts: What is wrong in a nutshell? What could have caused this?
Got this from another site of some guy who got this same error after upgrading.
Worked for me as well.
Apparently putting the following line in your eclipse.ini helps:
-Dcom.ibm.icu.util.TimeZone.DefaultTimeZoneType=ICU
Try setting the launch properties in:
Window>Preferences>Run/Debug(Expand)>Launching(Click)
Under launch Operations menu set it to:
Always launch the previously launched application
Click:
Apply>Ok
I never found out what went wrong, but a reinstall of eclipse fixed it. All projects survived seemingly undamaged.
Thanks for the reply on the .ini but that did no good.
I had same error today - in an eclipse installation (Juno SR2 64bit) that has been running fine for months.
0: There were no changes on svn for my projects since yesterday (when it was running fine).
1: I restored the workspace from a 'Windows 7 -> Properties -> previous copy' backup. This failed because the directory structure of the '.metadata' contains folders with a deeper structure than is supported.
2: I restored the workspace from a overnight archive (gzipped so file depth is not an issue).
This had no effect.
3: I tried to restore the eclipse installation directory (which seems to be updated an awful lot) from a 'Windows 7 -> Properties -> previous copy' backup. Again this failed - because of folder-depth issues (Note: it is installed in the root directory of my disk - so there is actually no way to use a restore on this installation!)
4: Had to delete the .metadata from my workspace and reinstall eclipse (and all the additional plugins), and re-import my projects, and setup all the servers, and android, etc, which took many hours.
The moral of the story? Backup both your workspace AND the eclipse installation every night manually. Windows Restore will NOT save you. Backing up your workspace is NOT enough.
I had the same problem using eclipse mars. I cleared the folder .recommenders\index
And that solved my issue.
Hope it helps.
incase you are having the eclipse files which you have downloaded from the official site .Just extract those file in the same folder where your previous eclipse was installed and select replace all.
best solution
I also encountered this issue, the reason why this issue occurred on my project was due to I was missing the JRE System Library in the root folder of my project.
To solve this issue, make sure you have the libraries like JRE System Libraries on the root folder of your project.

How can I add my application to Tomcat in Eclipse?

I have a web app built with Maven.
Most of the time, I built the application using Intellij IDEA, but now I want to import the application in Eclipse to see something in this IDE.
After mvn eclipse:eclipse, I add in Eclipse the app, but when I try to add the app to the server (tomcat), I receive:
There are no resources that can be added or removed from the server
Solutions?
You need the project to have a Eclipse Dynamic Web Module facet. You can try doing this via the project properties dialog and looking at project facets, then clicking the appropriate check box. This may not be available however, so you may need to do the next thing.
Create a backup of your project and follow the directions at dzone.com. This'll allow you to modify the project facets via your eclipse .project file.
Keep in mind, once you add those facets, you cannot change them back via Eclipse. Definitely make sure you have a backup before starting.
This step worked for me:
Right-Click on the Project Name, then
Maven-->Update Project..
Click OK
After doing this I was able to see my project in Add/Remove Programs.
As mentioned somewhere else adding Eclipse WTP didn't do any good, however I performed the above step after I had already added Eclipse WTP, so I am guessing that may not be needed.
This was done for Eclipse Juno.
Hope this helps someone.
Edited: You can follow this link as above mentioned I think might have needed WTP and that add a lot of other things into the workspace.
http://blog.teamextension.com/maven-as-eclipse-dynamic-web-module-556
Check whether Maven Integration for Eclipse WTP is installed. If not, install it from Eclipse Marketplace
After installation restart Eclipse
Right click your project and Maven--> update project configuration
Delete tomcat and re create tomcat (clean tomcat,add your project,publish and enjoy)
I've got Tomcat 6, Java 1.6, and was trying to get it to work in Eclipse Juno Service Release 1's "internal server" (whatever that's called.) Here's what I did that worked for me:
(Found these instructions at http://www.mkyong.com/eclipse/eclipse-ide-tomcat-version-6-0-only-supports-j2ee-1-2-1-3-1-4-and-java-ee-5-web-modules/)
I should point out that I followed ClutchDude's instructions to make my project a Dynamic Web Module facet. It didn't work on its own for me, but maybe it was part of making it work in the end.
Using Eclipse (or other text editor), open the file
.settings/org.eclipse.wst.common.project.facet.core.xml
Find the line that reads
<installed facet="jst.web" version="3.0"/>
3.0 is for Tomcat 7.x (so says mkyong.) Change it to 2.5 (or 2.4).
I restarted Eclipse and it worked for my project.
The reason why this is happening is because eclipse by default looks for the deployment descriptor in the folder {project.home}/Webcontent/WEB-INF/web.xml where as the Maven puts them in src/main/webapp/WEB-INF/web.xml.
So when you are trying to add your project onto the server eclipse cannot find a deployment descriptor and hence you get the annoying message.
This can be solved by adding the following entries in .settings/org.eclipse.wst.common which can be found in
Project home folder in your workspace if it is a new maven project.
The folder where you already imported from if you are using Import -> Maven projects.
Make the following changes in to the org.eclipse.wst.common
wb-resource deploy-path="/" source-path="/src/main/webapp"/. Add this entry.
Edit --> property name="java-output-path"
Please check the following link from more details. http://java.dzone.com/articles/webapps-eclipse-and-maven.
The comments section has an excellent example with a working project.
This issue was fixed for me my installing additional eclipse modules. in particular, the ones related to m2e-wtp. just do a search for m2e in the plugins search listing for your version of eclipse
If you face an error like "There are no resources that can be added or removed from the server",
then
1) Go to the META_INF of your websvcsEAR and go to the application.xml.
2) Goto modules-> clickDetails and add the module that is existing. i.e., some EAR which your project demands.
3) Click ok
4) Now go to your server -> right click -> add and remove -> add your EAR.
Maybe you don't need add your application to the server's configuration. I think that you must use m2e eclipse plugin in order to launch the app.
For example, in your eclipse you will see a contextual menu called "Run as" if you right-click on your pom file. You can clicking on "Maven build" and Maven will download all the information needed to start tomcat.
I hope this helps you.
I used
mvn eclipse:eclipse -Dwtpversion=2.0
in command line in the folder where I had my pom.xml. Then I refreshed the project in eclipse IDE. After that I was able to add my project.
I was able to resolve this by removing my EAR project from my Eclipse workspace, then re-importing it.
Well, with a Spring and maven project, i got it that way:
Eclipse Version: 2019-06 (4.12.0)
Java 1.8
Tomcat 7
Yes, go to Project Properties >> Facets >> select Dynamic Web Module but dont apply yet!!!
Right under, it should appear a link Further Configuration Available. Click on it, otherwise one will have to edit .settings/org.eclipse.wst.common.component manually. Update source directory to src/main/java. (source)
Then in Facets window check Java - mine was pointing to 11 even though i don't have Java 11 installed or configured like a JRE runtime. I could only add/remove when changed to 1.8. (source). Note: That was really the problem, why don't Eclipse get this configuration automatically from the project?
Finally Eclipse creates some directories like WEB-INF and META-INF, just delete them.