How can I import jetty source code into eclipse? - java

I'm trying to import the jetty source code into eclipse.
I went to:
Import -> General | Existing projects into workspace
then browsed to the folder that has all the jetty related projects:
Then it doesn't seem to pick up any of the individual projects, the projects pane is empty.
What am I doing wrong here?

Jetty is a Maven project.
You'll want to do the following ...
Install the m2e plugin.
[menu] Help > Eclipse Marketplace
Search for "m2e"
Install "Maven Integration for Eclipse"
Checkout the source code for jetty somewhere onto your disk (or just unpack the source zip file)
Import the maven projects
[menu] File > Import
[tree] Maven > Existing Maven Projects
[Next button]
Browse to the top folder of the jetty source tree.
Hit Next / Finish to then import all of jetty into eclipse.
Wait for Eclipse + M2E to settle down with its compilation and project setup.

Related

Can not to import SpringBoot Project into Eclipse IDE

I have tried to create a new SpringBoot Project by using the Spring Initializr. I choose Java version (language as well), Spring Boot version and all required dependencies. Download the zip file (and unzip it), and after that I ask IDE (I use Eclipse IDE) to import this project, but my IDE does not find the project file. Below I will attach image, perhaps it will help you. If you ever met this problem, share your knowledge please)
Can you check if Maven is installed and configured correctly on the installation path in the Window -> Preferences -> Maven -> Installations tab.
Also please try if you can import the project either as a Maven project:
If not please try to import the project as a file system as below and see if it succeeds,

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.

How do I import gradle projects with with EGit in Eclipse? (libGDX)

I am quiet new to git but for now I have set up a repository on Bitbucket. The repository contains my libGdx Project which is gradle project containing 3 sub-projects (Android, Desktop and Core).
So now it is my aim to clone this to eclipse using EGit. Everything works until i have to choose a wizard for the Import of the projects.
After i added the repo i use Import > git to Import a Project from the added repository
Here i have to choose the wizard
If i choose "Import existing Projects" the program tells me that no Projects are found.
After that i tried the "Use the New Project wizard" but it confuses me and actually i want to Import a gradle Project and not create a new one.
The last Option "Import as General Project" gives me just Folders and files, so eclipse doesn't notice the existing Projects. Like i said i'm quiet new to git so i appreciate every help ! :)
Thanks :)
The wizard intends to create the project settings files for Eclipse (.project and .settings/).
It seens like you don't have them in your git repository (I don't think you should). That why Eclipse asks you to create a new "project".
the best way is "Import -> Gradle project" (you need to have gradle plugin installed in eclipse first)
But is you don't want to use gradle plugin you need first to generate eclipse file. To do so, type "gradle eclipse" in your working directory (see https://docs.gradle.org/current/userguide/eclipse_plugin.html) and then import existing project into your eclipse workspace.
Another thing, it seems that your workspace is in the same folder as sources (.metadata folder), you should create your eclipse workspace in another directory.

Errors after importing Maven project into Eclipse

I imported a Maven project into Eclipse. I was able to deploy it from the command line. In Eclipse it is full of red Xs. I have cleaned the project, updated the configuration and I ran the following command:
mvn -Declipse.workspace=<pathtoworksapce> eclipse:add-maven-repo
and I still have the same problem. The project is dependent on another project.
What I ended up doing was removing all of the projects in Eclipse, but not deleting the source files. Then instead of directly importing the code as Maven->Check out as Maven Projects with SCM, I selected Existing Maven Project and imported the code from my local machine. This got rid of the errors, but when I would right click on code and select "Open Declaration", I would get Error: Could not open the editor: The file does not exist" So I removed all projects again and this time I deleted all the ".project" files and repeated the import Existing Maven Project. So now there are no red Xs (dependency problems) and the lookup functionality within the code works.
Go to your master project and type the following :
mvn install
mvn eclipse:eclipse
After that, import your project. You can also install m2eclipse for better support. If you use gwt or any other framework which has a custom maven execution, you should also install plugins for those in Eclipse.

Making Eclipse Recognize Imports

I am trying to integrate Spring into my project in Eclipse. I am using Maven and have added the dependencies in my POM. While the maven build works, Eclipse does not recognize imports like the following.
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
How do I get Eclipse to recognize Spring imports? I am hoping there is a way to do this w/o downloading the jar files, etc.
Thanks in advance.
Eclipse doesn't support Maven projects natively. You must install a plugin (m2eclipse) to be able to use a Maven project inside Eclipse.
Another way to fix this is to open a command line, navigate to your project, and run mvn clean install and/or mvn eclipse:eclipse the first will parse the pom.xml and download all the dependencies and the second will build your eclipse meta-data files(.classpath and .project) you can even do this with the project open in eclipse and hit F5 to refresh and viola
Check your maven path in eclipse.
Window >>> Preferences >>> Maven >>> User Settings
Check for User Settings field that contains settings.xml

Categories