Eclipse Error Logging - Not Showing Because of imported from GIT? - java

I have just started using the built in GIT functionality of Eclipse and I have everything set up and working, my problem as of now is that I realized my project that I imported from GIT is not reporting errors in my Java like the local copy would. I've tried the following,
Project -> Clean
When I right click on the property files of the folder I can't seem to choose a Java Builder.

It depends on how you import your Java (Git managed) project into the Eclipse workspace.
See "Importing a GitHub project into Eclipse" as an example.
The key is for your Eclipse project to reference the sources in the git repo folder (kept outside the Eclipse workspace folder, in any place you want).

Related

Eclipse maven EAR project not working after git share

I have a working maven project on eclipse which I made using the archetype for Jakarta EE with an ear packaging using windfly 21. (org.windfly.archetype - wildfly-jakartaee-ear-archetype).
After i got a working webpage, i decided to share it on git, using the eclipse GUI. (Right click on project -> Team -> Share).
This moves the project onto another folder, as it says that having git repositories inside eclipse default workspace folder is not recommended.
The problem is that after sharing it, even before I commit or push, it stops working. It stops recognizing packages and I'm unable to make it "run on server".
This is an image of how it looks after I share it on git. I cannot execute "p1parte1" or "p1parte1-ear" anymore (neither any of the other projects/modules), and the other projects below dont have the java classes inside.
I literally have no idea how to fix this, i've spent like 3 hours searching online and trying things.
I solved this by manually fully copying the project that was not shared in the eclipse workspace folder to the git folder.

Multiple Java Problem errors on importing existing maven project to Eclipse

I have an existing maven project which I downloaded from GitHub.
If I run mvn clean install from the root of the project everything works fine (a jar file is created in target folder and it executes works OK).
But when I go to Eclipse and import this project as Existing maven project I get multiple (395 to be precise) Java Problem errors (like The method is undefined etc.).
The only thing that I notice is when I run maven from command line it creates .m2 folder inside the project folder while maven from Eclipse creates .m2 inside my C:\Users\username folder.
I'm using Eclipse 2019-06, Java 8 and apache-maven-3.6.1.
P.S. Same errors appear when I import this project to Intellij IDEA 2019.2.
Olga, don't worry. Import the project into Eclipse. Then wait some minutes. If the errors do not vanish, try "ALT + F5". If this still does not help, build the project from within Eclipse ("Run As -> Maven build"), do "ALT + F5" again.
Eclipse often takes some time to fully "understand" the project, i.e. synchronise the POM and the files to its internal mechanisms.

using eclipse and netbeans on git

I am trying to work with a partner using a git repo. He uses netbeans but I use eclipse. I am having problems when I import the project into eclipse, the project has no classpath folder in eclipse so it cannot run and it is not highlighting errors in the code.
My question is is there anyway to work on the same git project with two different IDEs? And if so, how do I get eclipse to recognize the netbeans project folder to create its own .classpath.

Can I convert eclipse source folders into packages?

I've forked a Github project, used Eclipse to clone it locally, and imported that as a general project into Eclipse.
The accompanying .project file is an Eclipse .project file with the proper "nature" and "buildCommand" xml tags.
So it seems like a valid Eclipse project. However, I'm unable to specify a run configuration or configure the build path.
When I select the Build Path popup menu item, it says "no actions available" in grayed out text. When I select "Run/Run As" from the main menu,
it shows (none applicable). I'm wondering if the problem is that the project imported completely as source folders:
There are no packages to speak of. I created another project from scratch, and created the proper source folders and packages as needed
to match the package statements in the source code. After manually importing the source from the git repo, I can build and run that project.
If the lack of packages is indeed the problem, is there a quick way in Eclipse to convert source folders to packages?
What you did is you have probably cloned the repo in Eclipse and then Imported this project through a New Project Wizard, because in GitHub there is no existing .project (and no .classpath) files.
The "New Project Wizard" will create a set of defaults for a java project (I suspect that you selected just that), but is anaware of Maven structure, so all source folders will not be recognized and you will end up having to define them on your own. Worse, you will be unaware of any special parts of the Maven build that might be configured within pom.xml.
Because this project uses Maven for building, it would be better to use M2Eclipse while importing it. Install it using Help->Install new software.
Then there are a couple of steps required to make it use all Eclipse features.
Keep your cloned copy of the repository or clone again if you want to start from scratch. Then use File->Import feature to import a maven project into the workspace. Select Exisiting Maven Projects and point to the directory containing pom.xml file in the cloned repo. This will use Maven integration in Eclipse to generate .project and .classpath files based on pom.xml contents, so you will be able to more closely mimic Maven build in Eclipse. All source folders should be properly discovered this way. Eclipse might want to install some additional integrations for Maven features that this particular project uses. Let it, if that is the case.
Now, you will have the project operational and compiling in Eclipse, but it will not be aware that it is managed by Git... This is because M2Eclipse and Git Team provider are not integrated (at least they weren't when I last checked). In order to be able to commit to the repository in Eclipse, remove the project from workspace, but without deleting contents. Then, import from Repository view using Import Projects/Import exsisting Eclipse projects. Since necessary .project file is already generated, Eclipse will autodiscover the project and will use the right configuration prepared earlier by M2Eclipse.
In the end you will have a properly configured Maven project with Git as a team provider for it.
If this is a project meant to be built by Maven that contains a pom.xml file, install M2E before importing the project from your local cloned repository. It will handle this.
Right click at root of project select properties, in the sources tab add the folder "src/main/java" as source folder
Other way is to configure facet as java

IntelliJ Idea opens gradle folder instead of the project

I'm trying to import a GitHub project, specifically, this one : timtiemens/secretshare using IntelliJ Idea.
The git import works fine, at which point the IDE builds the project using gradle, which works fine.
However, when I actually open the project, only the gradle directory in the project is opened, ie, .../secretshare/gradle. The other directories, like src, are just not there in the IDE, even though they're present in the project folder - I can see them with explorer.
Just Delete the idea files created by inteillj
Run gradlew idea
Open the project again and choose use gradle wrapper settings.

Categories