Dependencies added but can't import correctly? - maven

<dependency>
<groupId>com.jde.jimie.data</groupId>
<artifactId>jde-jimie-sdk</artifactId>
<version>3.0-SNAPSHOT</version>
</dependency>
But when I tried to import a library from it, it says can't resolve the symbol.
import com.jd.jimie.data.sdk.eDataClient;
Specifically, in IntelliJ, it shows that "can't resolve symbol 'data'".
I restarted IntelliJ, but the problem persists.

Related

Maven error: package com.google.common.collect does not exist

In my pom.xml file, I have added
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>11.0.2</version>
</dependency>
and I have downloaded the jar file from https://github.com/google/guava/releases/tag/v31.0.1 and added it to my build path.
Eclipse recognizes the import, as it does not give an error on the import line which is import com.google.common.collect.Lists;.
However, when I run mvn package, I get package com.google.common.collect does not exist even after cleaning the project.
Is there something else I am missing?
I think you forgot to add <scope>system</scope> and <systemPath>path</systemPath>

package org.apache.commons.lang does not exist - Spring

I'm working on a Spring Boot Project. Everything was okay on yesterday. But today I woke up and open my VScode to remote server to continue my project. I get an error
In my POM.xml, there's already a dependency,
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.11</version>
</dependency>
I also try "mvn install -U". It throws me error,
package org.apache.commons.lang does not exist
I also searched on the internet, I've found some help from StackOverflow to use a command "mvn dependency:tree" to check there's a dependency exists or not. And here is it !
I'm stuck for an hour. Please help.
Finally fixed it ! It happened because I remove Eureka Client dependency.
After removing Eureka Client dependency, I need to change
import org.apache.commons.lang.StringUtils;
to
import org.apache.commons.lang3.StringUtils;

import of amqp from org.springframework get error

I'm working on existing Scala project which using the spring framework and I need to import org.springframework.amqp but when I tried to build the project I get:
Error:(15, 28) object amqp is not a member of package
org.springframework import org.springframework.amqp
It is really strange since I can see it in the formal website and I can see it in lot of examples in the web.
Any idea what is the problem?
A Maven dependency was missing. This is what I was need to add:
<dependency>
<groupId>org.springframework.amqp</groupId>
<artifactId>spring-amqp</artifactId>
<version>2.1.2.RELEASE</version>
</dependency>

Intellij can’t import dependency import by spring-boot-starter

I want use org.yaml.snake.Yaml in my springboot application. Since the spring-boot-starter has already included the snakeYML. thus I don't need import the org.yaml.snake.Yaml again in my pom.xml file.
when I type import org.yaml.snake.Yaml in source code, eclipse can exactly import it. However, when I use the Intellij it can't import the package.
As I edit the pom.xml and add below:
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>1.10</version>
</dependency>
It works fine!
I wander is this a bug of intellij?

Hadoop imports cannot be resolved in eclipse

import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
Learning hadoop programming from scratch.
I have written above line of code in eclipse.
it is showing error as "import org.apache.hadoop.io. cannot be resolved.".
I have already added external jar file "Hadoop-mapreduce-client-core-2.7.3,jar"
Is there anything else to add ?
In your all the dependents jar needs to be added, a single jar file wont help.
Try Using Maven.
Dependency is available on below link.
https://mvnrepository.com/artifact/org.apache.hadoop/hadoop-core/1.2.1
1) Convert the project to a maven project if it's not yet.Project>Configure>Convert to maven project.
2)Add this dependency :
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-core</artifactId>
<version>1.2.1</version>
</dependency>
This should resolve your errors. This worked for me!

Resources