Eclipse project can't find "org.joda"

eclipse project example
eclipse ide
eclipse tutorial
eclipse java
eclipse foundation
eclipse java program examples
install eclipse
how to write java program in eclipse step by step

I'm using Eclipse Kepler, and Apache Maven 3.1.1. I just installed both and did so properly as far as I know.

I'm trying to install Joda Time from the Maven repository. I added the dependencies to the pom.xml, but my project can't resolve the joda libraries even with a maven clean install.

My repository is located at USER_FOLDER/.m2/repository/. The joda-time folder and its contents are present there after I navigate to my project folder in a prompt and run "mvn clean", then "mvn install".

I haven't changed any build paths or other project settings in my Eclipse project.

Eclipse Maven integration is installed.

I followed this tutorial found on the Spring website: http://spring.io/guides/gs/maven/

My file structure is as follows:

USER
|____ .m2
|    |____ repository
|         |____ joda-time [and other folders such as org]
|              |____ joda-time
|                   |____ 2.3
|                        |____ _remote.repositories
|                        |____ joda-time-2.3.jar
|                        |____ joda-time-2.3.jar.sha1
|                        |____ joda-time-2.3.pom
|                        |____ joda-time-2.3.pom.sha1
|____ workspace
|    |____ hello
|    |    |____ [project files]
|    |    |____ pom.xml
|    |    |____ dependency-reduced-pom.xml
|    |    |____ target
|    |         |____ [compiled files. Nothing related to Joda, though]
|    |____ .metadata [with .plugins folder and others]

Here is my pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework</groupId>
<artifactId>gs-maven</artifactId>
<packaging>jar</packaging>
<version>0.1.0</version>

<dependencies>
    <dependency>
        <groupId>joda-time</groupId>
        <artifactId>joda-time</artifactId>
        <version>2.3</version>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-shade-plugin</artifactId>
            <version>2.1</version>
            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>shade</goal>
                    </goals>
                    <configuration>
                        <transformers>
                            <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                <mainClass>main.java.hello.HelloWorld</mainClass>
                            </transformer>
                        </transformers>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>
</project>

Here is my HelloWorld.java main file. On the import line, I get the error message "The import org.joda cannot be resolved".

package main.java.hello;

import org.joda.time.LocalTime;

public class HelloWorld {
    public static void main(String[] args) {
        LocalTime currentTime = new LocalTime();
    }
}
mvn eclipse:eclipse

Is also required to generate project files which includes .classpath for eclipse.

Very Basic Eclipse Users Guide, Eclipse will ask you for your workspace (where on your computer the projects you are working on will be  Opening the New Java Project wizard. The New Java Project wizard can be used to create a new java project. There are many ways to open this wizard − By clicking on the File menu and choosing New →Java Project. By right clicking anywhere in the Project Explorer and selecting New → Java Project.

Right click the project and click on Configure> Convert Project to Maven Project

Using the Eclipse IDE for Java programming - Tutorial, Projects can have multiple natures combined to model different technical aspects​. Natures for a project are defined  Project the Sun. Never look directly at the Sun without proper eye protection. You can seriously hurt your eyes and even go blind. Projecting the Sun through a box projector, or projecting using binoculars or telescope, or simply 2 pieces of card is a safe and easy way to view a solar eclipse. DIY: Simple Card Projector

Some things to try.

Are there any Maven errors whatsoever listed in the 'Markers' View? (Other than the missing import, of course). Frequently, a misspelled Maven configuration can be the cause of this problem.

If not, try one of the following:

  1. Right-click the project and select Maven->Update Project.

  2. Restart Eclipse.

  3. Delete the errors, quit, and run "mvn clean compile" from the command line. Start Eclipse, right click your project, and "Refresh".

  4. Delete the errors, quit, delete everything in your m2 repository, and run "mvn clean compile" from the command line. tart Eclipse, right click your project, and "Refresh"

  5. Sacrifice 50 bulls to Lord Eclipse. Sometimes this is the only resort. I don't like it, but the alternative is to shell out bucks for Intellij.

Importing Eclipse Projects into NetBeans IDE, After creating a NetBeans project from an Eclipse project, you can work in the following ways: Use NetBeans on a team project where other developers are using  In Eclipse you can then import this source-project the same way as you import the normal project. This way you'll have two (or more) projects, one for browsing the sources and doing version control, the other for building your project.

Project doesn't appear in Eclipse Project Explorer, and I can't import it, Generally, Eclipse is looking for Eclipse specific file in root directory like .project .​classpath that may be missing in your scenario,try to create  A "ring of fire" solar eclipse will briefly appear in parts of Africa and Asia this weekend, and if you aren't out there in person, you can take in the spectacular show online.

Eclipse IDE: Importing Files into a Project, We need a driver program which uses the class PairOfDice and which can be probably do not want to copy the text, so we will import the file into our project. The project import does not impose changes on the Eclipse project structure, so it does not interfere with the way the project works in Eclipse. Once you have the project imported, you can use either or both the NetBeans and Eclipse IDEs to edit, build, run, debug, and profile the project.

Eclipse Cookbook, Eclipse will open the New Project dialog and automatically create a new project corresponding to the CVS module. If you're sharing an Eclipse project, and each​  The next step is to contact the Eclipse Management Organization (EMO) to get some help and advice in drafting your proposal. You can contact the EMO via emo at eclipse dot org. Who is allowed to start an Eclipse open source project? Eclipse is an open and transparent community of open source projects.

Comments
  • Are you sure your Eclipse project is actually using m2e? Right-click on the project and see whether it has a Maven > submenu or an option to "add Maven nature".
  • This is not required if the OP is using m2eclipse, which he indicates he is.
  • This is what I was missing I think! However, now I'm getting the error "Error: Could not find or load main class main.java.hello.HelloWorld" when I try to run the project. This happens whether I set in my pom file the mainClass to be "hello.HelloWorld" or "main.java.hello.HelloWorld". @chrylis. I went to Help >> Install New Software, and used the link "download.eclipse.org/technology/m2e/releases" for the path. I tried to install the plugins that were listed, but that were already installed with the Kepler download.
  • You have Kepler, why not go into eclipse marketplace. This is under help option by the name of eclipse marketplace.
  • Does it mean anything if I right click on the project and I DON'T see any mention of Maven?
  • You need to add Maven nature to your project. Right click your project, select Configure->Convert to Maven Project