jar works in classpath not in targetplatform eclipse - java

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.

Related

Cant load maven projects in eclipse on Ubuntu 16.04

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.

Eclipse Error:Target runtime jre1.8.0_31 is not defined

enter image description here
I have imported one Maven project. During compilation of project I am facing some errors, which are described in image.
IDE version
Eclipse Java EE IDE for Web Developers.
Version: Mars.2 Release (4.5.2)
Build id: 20160218-0600
It seems your .class files are not generating. Try cleaning your workspace, then refresh maven dependencies in eclipse.
This will hopefully solve your problem, if your environment is properly set.
I had the same issue and to fix it I finally did a find/grep for the missing runtime name. This turned up .settings/org.eclipse.wst.common.project.facet.core.xml which contained a line <runtime name="jdk1.8.0_66">. I deleted that line and did a refresh on the module and everything was fine.
Got Project Build path and then select Targeted Runtime Select desire jre and apply the changes . After clean project everything worked fine for me.
Check the targeted runtime in the Properties of the project:

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)

GWT_HOME does not exist (mac 10.8.3)

I'm running Eclipse Juno on a mac os 10.8.3.
I installed GWT (2.5.2) plugin with eclipse, but when I try to run my project, there's always this error:
BUILD FAILED
/../../${env.GWT_HOME} does not exist.
Also on my build file, in the following line:
<taskdef resource="dml-ant.xml" classpathref="project.classpath"/>
It shows an error with the same thing.
Now I've seen both THIS and THIS threads but none of the solutions worked.
Outside of eclipse I've GWT_HOME defined in the .profile file, as this:
export GWT_HOME=/Applications/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.5.1
Inside Eclipse, I have this configurations:
- Preferences->Google->Web Toolkit-> GWT::2.5.1::[Location of the gwt-2.5.1 folder in plugins]
- Preferences->Java->Build Path->Classpath Variables-> GWT_HOME [defined to the same place]
In my project:
- Properties->Google->Web Toolkit (only one selected)-> Use default SDK (GWT - 2.5.1)
- Properties->Java Build Path->Order and Export->GWT SDK [GWT - 2.5.1] almost on top (above maven libraries, at least)
I've tried some stuff like changing the gwt-2.5.1 folder (and the GWT_HOME path with it), reinstalled several times and with older versions, several restarts both to eclipse and the computer, etc.
I may be missing something obvious here, it's the first I'm working with GWT (and one of the firsts with Eclipse).
Thanks in advance for all your help :)
Your project is setup with ant, isn't it?, If so:
It seems your ant file build.xml does not have the line:
<property environment=”env”/>
It would be happenning as well that when running eclipse it does not pick up the environment variables you set in your .profile, maybe you have to launch eclipse from the command-line.
Eventually, as a quick fix edit your ant.xml file and replace all occurrences of ${env.GWT_HOME} by /Applications/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.5.1.

java.lang.Object cannot be resolved in Eclipse

When I installed the latest installment in Mac OSX - the Mountain Lion - I experienced some problems getting Eclipse to work I also lost most of my Android developer files (but I still have my projects). I suspect this is due to the choice of removing the /Developer and move the XCode and other Apple developer tools (I placed my Android tools here).
I have now installed the latest version of Eclipse and the problem still seems to be around. There are errors in all my projects and I get an error message prompting:
The type java.lang.Object cannot be resolved. It is indirectly referenced
from required .class files
I tried to check the Java class-path both in Eclipse and in my terminal and these seems to be OK. java and javac both run in my terminal and there is a valid path to the java source files in Eclipse (Under Preferences, Java, Installed JREs). That being said I'm not an expert in Eclipse so there may be that I have misunderstood how this problem ought to be solved. Anyone here with similar problems or who know the cure?
Make sure that you have a valid JRE or JDK defined in the Java Build Path of your project. Right-click on your project, select Properties... and then Java Build Path.
I had this problem moving a Maven project from Eclipse to RAD. I had a JSP file that worked in Tomcat and JBoss, but threw a NullPointerException in WebSphere on the form definition during the compile.
Anyway, after transforming the Maven project into an Ant project (mvn ant:ant), I imported the Ant project into RAD and got this error. The fix:
Open the Java Build Path, selecting the Libraries tab.
Find the JRE System Library and remove it.
Add the JRE System Library.
Goofy, but it works. It must reset some property in a file. I don't know if the problem is the older version of Eclipse or RAD.
After updating my Android SDK to make Appcelerator Titanium happy, I started getting "java.lang.Object cannot be resolved" for my Android projects in (non-Titanium) Eclipse.
I updated all dependencies in Eclipse, and the error healed after a restart of Eclipse.
I had that error almost every time I launched Eclipse for the first time; if I close and then re-open Eclipse, the error is gone.
I found this solution useful, though (I've copied here to protect the link, credit goes to the original author):
In Eclipse go to Windows -> Preferences -> Java -> Installed JREs.
Select the currently active JRE/JDK and press the Edit button.
Select the rt.jar and change its position in the list of JRE system libraries (e.g. press the Up button once).
Confirm all changes, clean and rebuild the workspace.
The next time you face the problem reposition the rt.jar again (or reset the order by pressing the Restore Default button).
please select your installed system jre version from java build path.
Try the following and problem will go away
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.
This is an annoying Eclipse Bug which seems to bite now and then. See http://dev-answers.blogspot.de/2009/06/eclipse-build-errors-javalangobject.html for a possible solution, otherwise try the following;
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.
The better cure is to try NetBeans instead of Eclipse
I got this error and what I had to do was remove the JRE from the Window/Preferences/Java/Installed JREs and re-add it. This somehow cleared up eclipse's cache and rebuilt the project successfully. To get rid of the error in the file-editor I also had to close it and open the file once again.
My problem was that I had in Eclipse: Window / Preferences... and then in the tree on the left Java / Installed JREs: C:\Program Files\Java\jre7
I changed to: c:\Program Files (x86)\Java\jre7
It solved my problem.
I had the same issue and none of the above solutions worked for me.
Then I realized than the library (libs) folder was missing in the project. Once i added the libs folder and the corresponding Jar file, the issue was resolved..
If your project specific (or if not applicable, workspace default) JDK/JRE is being referenced correctly and you've just begun to get this issue out of the blue: restart Eclipse.
Unfortunately, "restart Eclipse" is one of the standard troubleshooting steps when a project won't build. Eclipse even has a dedicated entry under the File menu.
I had to add the JDK under the build path. After adding the correct build path it worked.
I just had to restart eclipse, and the error went away. Strange.
I solved this by pointing my eclipse to the jre available in jdk.
This error caused by invalid sdk is pointing in your project.properties file of your project.
project.properties -> target=android-19 . change to version which is installed in your eclipse.The error will be gone.
I had the same issue after moving from JRE7 to JDK7. Finally I had to remove the JRE7 configuration from the Eclipse preferences and then add the following two lines to the eclipse.ini file.
-vm
C:\Program Files\Java\jdk1.7.0_55\bin\javaw.exe
I had this problem, and I understood that Eclipse has automatically imported a core reference, instead of the reference for the project I needed.
Deleted the import, and rearranged it, and everything worked fine.
Same problem facing Me
Project->properties->Android
And select the api level and also go in java build path and check some external jar file path if we already add in it.update the jar file path
On "The type java.lang.Object cannot be resolved. It is indirectly referenced
from required .class files":
I found my project had 2 meta-inf.java files in 2 different directories with the same 'module ' on line one (a copy/paste error).
Once this was corrected, I cleared the meta-inf.java file with the issue, rebuilding it line by line, guided by Eclipse, until I had a working module configuration.

Categories