I am new to Java
I have been trying to compile my open source application
with provided steps
Import Project from Maven
1. Start IntelliJ IDEa.
2. In the "Quick Start" menu, select "Import Project".
This will open a "Select File or Directory to Import" dialog.
3. Browse to your local cTakes repository root directory and select the pom.xml file.
4. Click "Ok".
This will open an "Import Project from Maven" dialog.
5. Make sure the "Search for projects recursively" box is selected, just in case any cTakes modules are not in the pom.
6. Make sure that "Create IntelliJ IDEa modules for aggregator projects" is not selected.
If you plan to add new module, 'disable' a present cTakes module or make other changes to the main pom.xml, check the "Import Maven projects automatically" box.
See also: http://www.jetbrains.com/idea/webhelp/maven-importing.html
7. Make sure that "Create module rgoups for multi-module Maven projects" is not selected.
8. Make sure that "Keep source and test folders on reimport is selected.
9. Make sure that "Exclude build directory (%PROJECT_ROOT%/target)" is selected.
10. Make sure that "Use Maven output directories" is selected.
11. Make sure that the "Generated sources folders" option "Detect automatically" is selected.
12. For the "Phase to be used for folders update" the default option "process-resources" should be fine.
13. For the "Automatically download" options, you may select what you like, but be wary that if broken code has been checked in you may need to revert manually.
14. The default "Dependency types" are fine.
15. Click "Environment settings...".
This will open a dialog that can be used to set options about the Maven environment.
16. The default maven environment settings should be fine. If $M2_HOME is not set in your environment you may select a "Maven home directory", but it is better to set $M2_HOME in your environment.
17. Click "Next".
This will inspect the cTakes Maven settings and search for profiles. It should display a dialog with the possible cTakes profiles.
If you plan to run the UIMA CVD or CPE then select the appropriate profile. Neither is necessary
18. Click "Next".
This will open an "Import" dialog with the current version of cTakes displayed.
19. Click "Next".
This will open a dialog allowing you to select a Java SDK version.
20. Click the "+" button in the top left.
This will display a drop-down box with options for an SDK.
21. Select "JDK".
This will open a dialog to select a Java JDK directory.
22. Navigate to a directory with a JDK version 1.8 or later and click "Ok".
This will display a listing of the file paths associated with the selected JDK.
23. Click "Next".
24. Click "Ok/Next"
The project will load. This may take a while.
25. Important: If you are asked about adding any .iml files to svn, click "No".
26. You should now see the full cTakes project structure in IntelliJ.
I get everything up to step 4
but step 5 does not exist in my case
I mean in step 5
5. Make sure the "Search for projects recursively" box is selected, just in case any cTakes modules are not in the pom.
There are no options I get, it immediately takes me to the IntelliJ project
I get this screen
after I ckick finish , it takes me to this
Am I using older version? or doing something wrong?
How to get the Maven options as the instructions suggested?
It appears that you're in a unique position where the import and the recursive scanning of projects has Just Worked™ for your use case.
Given that IntelliJ IDEA 2019.3 came out at the end of November 2019 and I'm not reasonably convinced that those instructions were written or revised between the end of November and now, it could easily be the case that the instructions you've seen are out of date.
The big thing to be sure of is that your subprojects also build. On the right-hand side there, you have a list of Maven projects. Any one of those should be subprojects. Be sure that any Maven build command (e.g. mvn clean install) executes in the context of that subproject.
I have downloaded a simple project from a Git repository and opened it in Intellij. A couple of the import statements are highlighted in red, stating "Cannot resolve symbol." The packages that cannot be resolved are: zaxxer, springframework.
Normally in Perl or Python I would fire up a dependency manager like CPAN and simply install them, but my understanding is that there isn't really any such thing in Java and that dependencies are resolved sort of on a project-by-project basis.
I have Maven 3 installed, and my project has a pom.xml file, for what it's worth. What should I do now?
If you have opened the project in IntelliJ you can right click the module and choose "Add framework support". Choose Maven there, if it isn't there then it is already enabled.
Then, simply open your pom file. When indexed there should appear an dialog in the lower right corner asking you if you want to auto import changes or just import them manually. Click on one of them and the dependencies will be added.
If you can't see this notification it may have already been shown, then simply press on the "Event log" in the bottom right corner and the notification should be displayed (with eventual other info).
Edit from OP: Solution was: 1) Turn on the view in View > Tool Windows > Maven Projects. There was no Maven project here, so I added it (selected the pom.xml). 2) As described in an answer at Failed to Read Artifact Descriptor: IntelliJ "In Intellij, go to File -> Settings -> Build, Execution, Deployments -> Maven Check the box, ‘Always update snapshots’
It's a little weird that "always update snapshots" isn't turned on by default for IntelliJ, but this got things working.
I am currently trying to get the git annotations in eclipse mars for a Java file, to see when a line was changed. In Luna, this worked (and still works) with Team -> Show annotations. In Mars, this does not work for me. (Also after reinstall and on a different computer). For other files, for example the pom.xml of the maven project, this works. The project is, besides, this problem, working and compiling fine in eclipse and was created based on the pom.xml in eclipse. Also when the project is created via mvn eclipse:eclipse, show annotations is not working.
I've read the settings with Ignore whitespace changes and Preferences > General > Editors > Text Editors > Annotations > Errors > Show in > Vertical ruler (Show annotations not working), which are correct. Also closing and reopening the Java perspective did not work (https://www.eclipse.org/forums/index.php/t/1011988/). I could not find any other recent threads about this.
Is there some configuration for Java that I am missing, or is this an eclipse bug?
Right click on the file . Team -> "Show Revision Information" - in
Eclipse Neon.
Right click on file -> Team -> Show Annotations. - In previous eclipse versions
I had the same problem. Did you check if your Git repository is imported correctly? For some reason mine wasn't.
Check the Git repositories view (Window > Show view > Other > Git > Git Repositories). If you cannot see the repo there, add it and afterwards you should be able to choose "see annotations" under team.
A little bit old, but maybe to close this question.
You will have to "share" your projects.
Right click the project/projects -> Team -> Share Project.
I did select all relevant projects first and then right-clicked to share the projects. Sometimes this does not work, if a project is in the selection list, that has different porperties.
This will connect your project with your git repo.
Good luck.
While compiling an android project in eclipse 3.4.2, I am getting The project cannot be built until the build path errors are resolved.
I got a temporary solution from the blog http://www.scottdstrader.com/blog/ether_archives/000921.html
The resolution was to force a resave of the selected projects (and their .classpath files):
Open the project properties
Select Java Build Path > Libraries
Add a new, arbitrary library (to be deleted later) > OK
Wait for the workspace to refresh (or force a refresh of the project)
The error(s) will go away
Remove the dummy library
The only other references I could find were to make minor alterations of contents of the .classpath file.
Is there any permanent fix for this issue?
Have you tried using Project > Clean... from the menu? This will force a new build on the selected projects in Eclipse.
1-Right CLick on your project folder, Choose Build Path > Configure Build Path
2-Select Libraries Tab and delete any arbitrary library present there.
3-Click on Add Library option, Select JRE System Library and click Next.
4-Choose last Radiobutton option Workspace default JRE and click Finish.
5-press f5 for refresh.
6-run ur program .
This what fixed it for me...
I was having an issue with my spring-core.jar.
I deleted the entire release directory located here. (I'm on win 10).
C:\Users********.m2\repository\org\springframework\spring-core\4.3.1.RELEASE
I right clicked on the project > Maven > Update project and my exclamation mark disappeared. No problems any more.
Here is the source where I found the information:
http://crunchify.com/cannot-be-read-or-is-not-a-valid-zip-file-how-to-fix-maven-build-path-error-with-corrupted-jar-file/
This happens when libraries added to the project doesn't have the correct path.
Right click on your project (from package explorer)
Got build path -> configure build path
Select the libraries tab
Fix the path error (give the correct path) by editing jars or classes at fault
This works for me: close the project then re-open it, this will force eclipse to reload a fresh project and detects the correct build path.
None of the other answers worked for me. Even after fixing my build path issues, doing a refresh, clean, rebuild, and restart (of both eclipse and the computer), I was still getting the little red exclamation point.
I fixed it by closing the project (right-click, close project) and reopening it (double-click the closed project), which seemed to force eclipse to "notice" that the build path problems had been corrected.
For my mac osx Eclipse, I followed following steps:
Right CLick on your project, Choose Build Path > Configure Build Path
Select Libraries Tab and delete any arbitrary library or anything else causing errors in Build Path.
Click on Add Library button, Select JRE System Library and click Next.
Choose last Radiobutton option Workspace default JRE and click Finish.
Clean and build your project.
get a cmd and run
mvn eclipse:eclipse
This is what worked for me:
Go to ~/.m2/repository and deleted everything there by running rm
-rf. Make sure everything is deleted.
Re-launch eclipse or STS
Right click on project -> Maven -> update project.
On my Mac this is what worked for me
Project > Clean (errors and warnings will remain or increase after this)
Close Eclipse
Reopen Eclipse (errors show momentarily and then disappear, warnings remain)
You are good to go and can now run your project
I've seen this problem a few times (got it again right now on my home computer with Eclipse 4.2).
Forcing a resave (by changing the classpath e.g. by adding a library, save, change-back) works temporarily. But the problem comes back when Eclipse is restarted :(
Nuking the Eclipse workspace from orbit will permanently fix it (until next time). But there must be a better way!
just check if any unnecessary Jars are added in your library or not. if yes, then simply remove that jars from your library and clean your project once. Its worked for me.
In Eclipse this worked for me: right click project. -> Properties -> Library Section; Add (any library at all) -> select library and click remove -> press okay.
I ran into this annoying issue with the Play framework. It would be nice if there was some way of knowing what build errors Eclipse is unhappy about, but it's not going to tell you. With one project, I was able to close the project, rebuild the Eclipse configuration with sbt eclipse, and reopen. With an almost identical project, that didn't work. But deleting the project, rebuilding the Eclipse configuration with sbt eclipse, and importing, did the trick.
If you think you've done everything correctly but Eclipse still complains about the jars, refresh the folder where the jars are and make sure eclipse knows they've been added to the project. Specifying the file path alone is (apparently) not enough
I've faced this issue a couple of times and following the below steps has resolved both the times.
1. Navigate to C:\Users\
2. locate the ".m2" folder and delete it.
Now navigate to the particular project in eclipse and Right-click on the project > Maven > Update Project
wait until the project is updated and in my case following the above steps resolved both the times.
I was getting an additional warning
The compiler compliance specified is 1.6 but a JRE 1.8 is used
Resolving this warning make the error also go away. The steps are as follows:
I right-clicked on it, then clicked on Quick Fix. From the dialog that opened I selected Open the Compiler Compliance property page, and clicked the Finish button.
(This is same as Java Compiler section.)
In this dialog I found the Compiler compliance level drop down and changed 1.6 to 1.8, and clicked on Apply and close.
I got a message box Compiler Settings Changed which asked if I wanted to Build the project now?. I clicked on Yes.
The build path error went away.
Go to > Right CLick on your project folder > Build Path > Configure Build Path > Libraries Tab > remove project and external dependencies > apply & close
Now, Gradle refresh your project.
Added below to pom.xml file and it worked eventually:
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.0</version>
<scope>provided</scope>
</dependency>
Goto to Project=>Build Automatically . Make sure it is ticked
When I load up a workspace (for Android Java development), Eclipse says in the status bar that it's updating indexes. The Progress tab reports that it's hitting maven.org.
I read up on Maven - seems like a build manager. What I don't understand is why my Android workspace needs it or why it's hitting the server in the cloud. Do I need it? If not, how do I safely remove it?
This is a general step that happens when m2e/m2eclipse (Maven integration for Eclipse) is installed, whether projects are actively using it or not.
This step can be disabled through the Eclipse preferences: Window / Preferences / Maven / "Download repository index updates on startup". This option is on the main "Maven" preference page (not a child page). Just uncheck the box to prevent this from happening.
The file that this is downloading is an index of all the available dependencies available in the Maven central repository for use in Maven-enabled projects, allowing them to be easily chosen and searched against within the Eclipse UI. It is mainly a user convenience, and isn't mandatory.