I am Unable to see src/main/java in eclipse but whenever I run the class it shows the error I have also checked the build path there is no file missing.
It is resolved I have deleted recent added dependency "netflix-hystrix" one and after force updating the maven my src/main/java got restored I didn't how but it works in my case
Related
I committed my eclipse project on GitHub and since then, every jsp is creating an issue.
I tried Git staging and everything is synced with GitHub.
Website is working fine too.
But I can't resolve the variable or any java object.
May be your project class-path missing the jar file Servlet-api.jar. Please check and add manually this jar into your classpath, then restart the server.
Solved:
Java Library Unbound problem
Went to Java Build Path in properties.
selected the conflicting JRE Library
Go To Edit-> Selected Workspace Default JRE.
Click OK.
Done.
My problem is resolved but I don't understand why it wasn't working.
Using: Grails 2.4.2, Groovy 2.3.7, Java 1.7, Eclipse- Indigo
I set my project up, and in the assets folder under grails-app I placed my static assets. I was also using twitter-bootstrap. The project would run, but nothing would be displayed from the assets folder. I did a Grails clean and got build path errors. in Eclipse right clicking the project name and going to Java Build Path and under the source tab there were links such as:
projectName/.link_to_grails_plugins/cache-1.1.7/src/java
or
projectName/.link_to_grails_plugin/asset-pipeline-1.8.11/grails-app/controllers etc
I deleted my target directory, and deleted all the links that were errors inside the Source tab. I restarted eclipse and refreshed, and voila it worked. The links came back, looked exactly the same but were now good apparently. I'm just not 100% sure why it worked though. The assets were in the right place, and never moved. Why did this work?
Eclipse doesn't parse BuildConfig.groovy or infer paths or dependencies - it gets all of that from Grails. You can force it to reconfigure the classpath by right-clicking on the project node in the tree on the left and selecting Grails Tools | Refresh Dependencies. That will cause Eclipse to run grails compile --non-interactive --refresh-dependencies and it gets classpath information from that.
When you restarted it must have determined that enough had been deleted that it needed to refresh itself, or it might just do that each time you restart.
I'm trying to convert an eclipse Java project to a Maven project. When I convert the project to a Maven project, the pom.xml displays the following error:
Cannot read lifecycle mapping metadata for artifact
org.apache.maven.plugins:maven-jar-plugin:maven-plugin:2.3.2:runtime
Cause: error in opening zip file
When I check the lifecycle file, it's blank. Any idea of why I can't convert this project without getting this error?
Thanks for the assistance!
If that file is empty, it might have been caused by a bad download of the maven artifact. Therefore check your proxy settings in Eclipse as well as in Maven itself (~/.m2/settings.xml)
One thing you can try is deleting the project(from the workspace, not from your computer!) and importing it as a maven project using the deleted project's folder as your source. I've had a lot of trouble in the past with converting projects with m2e, but deleting/re-importing always seems to do the trick.
To import an existing project as a maven project go to file->import and select "Existing Maven Project". Select your project's folder, and import. I realize it's basically the equivalent of "turn it off and turn it on again", but like I said, it has always worked for me in the past. At the very least it will help you narrow your scope.
Hope this helps!
I am seeing a problem whereby the Eclipse Debugger cannot find the source for classes that are included as project references.
My application contains 2 types of referenced libraries: those in the Maven repository, and those that are included as part of a project reference to another project in my workspace.
The debugger has no issue showing source for any classes in the Maven repository.
However, when it tries to debug classes included using a project reference then it cannot find the source. Even when I click on the "Edit Source Lookup Path" and specify the location of the project it cannot find the source. I have confirmed that the class in question does exist in the project's output folder so I'm not sure what the problem is here.
Can someone please help?
Thanks
OK, I've resolved this almost as quick as I opened it.
The problem seems to have been caused by the way I was importing my application's project.
So in Eclipse, I imported this using m2e's File > Import > maven > Existing Maven Projects.
This resulted in dependencies that existed in my workspace being included as project references instead of actual jar file references to the Maven repository.
To get the actual jar file references to the Maven repository, I ran mvn eclipse:eclipse and my debugger was able to pick up the source code.
Is this a known problem with the m2e plugin?
I added a classpath variable (via eclipse's build path) that points to a cache of jars. While this folder is represented in eclipse's folder view, the contained jars are not recognized for some reason.
For example, when I import a class that is present in a jar in the cache (and thus the added classpath variable), eclipse indicates that the class can not be resolved.
Any ideas what is wrong and how to resolve it?
You have to make sure that the jar(s) that you want are actually included in the classpath of the project you're working on. Right-click on the project, go to properties -> java build path and make sure you've added the jar to your project.
I think this is the problem you are having : https://bugs.eclipse.org/bugs/show_bug.cgi?id=70417
So go vote for the enhancement - it's the only way things like this get done!
I too struggled with the same problem and finally got the solution for it. Just copy the jar's in your server's lib folder eg)apache tomcat's lib folder and then run the project.