Cant load maven projects in eclipse on Ubuntu 16.04 - java

I have just installed the newest version of eclipse on my ubuntu 16.04. But every time I try to import a maven project I get this kind of errors shown on the picture.
Also, all dependencies and plugins has .lastUpdated sufix, which means I guess that there is some kind of a problem and it wasn't downloaded correctly. I've tried removing everything from .m2 folder and letting eclipse download dependencies again, didn't work. Also tried to add <maven-resources-plugin> explicitly in the .pom and that didn't help also. Tried using both embedded maven from eclipse and installing my own from terminal, and setting eclipse to work with that, but no luck.

I faced this problem few month ago, and the only way was to remove Maven Integration Plugin from Eclipse and re-install it from the marketplace.

Fiiinally 7 hours later I figured it out. What I had to do was to change jdk. Initially I installed it from terminal and the exact name of it was java-8-openjdk-amd64. That somehow made a problem to maven and it couldn't download dependencies.
Once I removed the current version of java, downloaded jdk-8u171-linux-x64.tar.gz from Oracle-s website, extracted it into eclipse-installer/jre before installation, deleted everything from .m2 so those .lastUpdated files will be removed, it finally worked.

Related

issue while installing FindBugs in NetBeans 8-2 [duplicate]

I am getting below error while installing Findbugs into Netbeans 8.2:
"There were some problems while storing Establishing a connection …
Cause: Cannot resolve external reference to m2:/org:ow2:asm:asm-debug-all:5.0.2:jar"
I have tried uninstalling NetBeans 8.2 and removing anything associated with the installation to get a fresh install with no success there, and I have tried the latest version of NetBeans 11.3 which I found does not have Findbugs available. I need the plugin for a school project and no one there has been able to help me with this issue either. Any help would be greatly appreciated.
I am using a Windows 10 PC.
Thank you.
The reason of the error
The error happens because when you download the plugin, NetBeans also tries to download additional dependencies. The links where to download the jars from are written inside the nbm package.
For example, one of the dependencies is asm-debug-all-5.0.2.jar, and the link is:
http://repo1.maven.org/maven2/org/ow2/asm/asm-debug-all/5.0.2/asm-debug-all-5.0.2.jar.
The maven repository is no longer accessible using the HTTP link. You can read more about it here.
So basically, you could not install the plugin because the plugin is outdated and contains invalid links for downloading dependencies from maven repo.
Before solving the issue, consider using SpotBug instead because the FindBug is outdated and is no longer actively maintained, for more information, please, see here in another answer. Also, keep in mind that it works only with JDK8.
How to solve it?
To solve the issue, you need to fiddle around a bit with plugins.
You need two plugins FindBug Libs (org-netbeans-libs-findbugs.nbm) and FindBug Integration (org-netbeans-modules-findbugs.nbm). Download them using thees links:
https://updates.netbeans.org/netbeans/updates/8.2/uc/final/certified/82/extra/org-netbeans-modules-findbugs.nbm
https://updates.netbeans.org/netbeans/updates/8.2/uc/final/certified/82/extra/org-netbeans-libs-findbugs.nbm
Unzip org-netbeans-libs-findbugs.nbm manually as if it is a simple zip file.
Edit the files in org-netbeans-libs-findbugs\netbeans\modules\ext extracted folder. In every file, you need to change the link from http to https.
Edit manifest file org-netbeans-libs-findbugs\META-INF\MANIFEST.MF. You need to remove all lines that contain CRS checksum. After editing it should contains only these lines:
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.9.2
Created-By: 1.8.0_45-b14 (Oracle Corporation)
Remover other two files in org-netbeans-libs-findbugs\META-INF (ORACLE_C.RSA and ORACLE_C.SF).
Zip it again.
After that, the file is ready for manually installing into Net Beans. Alternatively, you can download the file from here. I have already modified the plugin using the steps.
How to install and use it?
Got to Windows -> Plugins -> Downloaded -> Add Plugins
Manually add the modified org-netbeans-libs-findbugs.nbm file and click install.
Then add org-netbeans-modules-findbugs.nbm and click install.
When installing, it shows that it downloads the plugin, but actually, it downloads only dependencies. It can take some time.
After that, select your project in the project tree, make sure it was compiled before. Got to Source -> Inspect, choose FindBus in the Configuration.
After you click to inspect your report will be ready.
It works both on NetBeans 11.3 and 8.2. Make sure you are using JDK8 with NetBeans. I'm not sure it will work with the newest versions of JDK.
Here is an example with running it on 11.3 using JDK8 on some NetBeans module:

Imported project into Eclipse and shows errors right away

I'm using Eclipse Oxygen.1 release 4.7.1 and I'm running jdk and jre version 9 64-bit on a MacOS Sierra system. I imported a project downloaded from the internet and it's showing 2 errors:
1) The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object. Fix the build path then try building this project
2) The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files
Has anyone ever experienced this? It must be a bug with Eclipse because all I did was import the project and it should work fine. I tried several ways to debug like clean the project and remove the JRE system library then add it again and refresh. Also tried restarting Eclipse several times and restarting my computer. Even reinstalled the JDK and re-downloaded and imported the project a few times. Any feedback would be appreciated. Thank you.
This is a rarely occurring bug in eclipse. Here are the steps to solve it, straight from this answer:
Close the project and reopen it.
Clean the project (It will rebuild the buildpath hence reconfiguring with the JDK libraries)
OR
Delete and Re-import the project and if necessary do the above steps again.

InteliiJ Idea doesnt download maven dependencies

Today i receive notification about InteliiJ Idea's update and decided to do it. However i was using trial version of the Ultimate edition and decided to switch to community
Uninstalled ultimate version (performed OS restart), deleted all cache/profile/m2 old files and installed community version. Imported my old project, added Framework support to maven and did "Reimport".
None of the dependencies is being downloaded. Wheneever i try to add new dependency the text becomes red.
I tried everything reimport, clean, mvn clean, mvn install, even did a reinstalled the program and still my dependencies are not being downloaded.
Auto-import is on and pom. is not in the ignored list.
Delete everything but the .java files i wrote. Restarted the project then added framework support and now everything is fine

Cannot build jhipster project in eclipse

I cannot build a simple project (just created with yo jhipster) in Eclipse.
I'm getting the error:
Maven Dependency Problem
Missing artifact com.sun:tools:jar:1.6
Thare are other errors too but i think this is the one that is causing problems.
I can compile and run the same project from command line with mvn spring-boot:run
I googled for the error and found lots of solutions but unfortunately none worked.
If i check Eclipse configuration i can see that java.home points to C:\Program Files (x86)\Java\jre7 no matter what i do.
I tried to edit the eclipse.ini file adding -vm C:\Progra~1\Java\jdk1.7.0_51\bin\javaw.exe
I also double checked that my workspace and project are using a Jdk and not a Jre Vm.
Can someone please point me to the right direction please?
Thanks!
I had the same issue before... you are probably running your Eclipse with a JRE rather than a JDK. The sun tools jar is actually part of the latest JDK, and doesn't necessarily need to be inferred directly in your project.
See my comments, issue #1, in the attached link:
JHipster Eclipse project running out of memory in "main"
Try with STS and everything works. Seems to be an issue with your eclispe
I've imported the sample jhipster in Eclise (without STS) and everything was OK, after installing the maven dependencies.
To run the project, run as an application and search for the Application (com.mycompany.myapp.Application)

jar works in classpath not in targetplatform eclipse

I have a jar that is working fine in Eclipse in other peoples Eclipse environments here.
When I add it to mine, it does not get resolved but when I open target platform state, it is present there.
If I had add the jar to classpath as an external jar from the folder in the target platform, it resolves everything correctly and build is fine.
Does anyone have any idea what could be causing this? I've tried new target platform definition, new workspace, new Eclipse version etc... I don't think it is an issue with the jar as it is working for the other people in my team.
Eclipse info:
Version: 3.7.2
Build id: M20120208-0800
Anyone anything else I should try?
Moved to linux environment and issue disappeared using Eclipse 3.8.1.

Categories