I am unable to resolve error - The import retrofit2.converter cannot be resolved
I am using Eclipse Mars and added following JAR files as External JAR's
retrofit-2.1.0.jar
moshi-1.2.0.jar
it resolves "import retrofit2.Retrofit;" .. but unable to resolve "import retrofit2.converter.moshi.MoshiConverterFactory;"
I am not using Maven .. but just adding JAR files .. any idea?
Thank you,
Jagdish
Added following dependency to pom.xml .. helped to resolved the issue.
<dependency>
<groupId>com.squareup.retrofit2</groupId>
<artifactId>retrofit</artifactId>
<version>2.1.0</version>
</dependency>
Related
I am getting the saxon-importing error like,
The "import net.sf.saxon.FeatureKeys" cannot be resolved.
How can I add the dependency to resolve the "net.sf.saxon.FeatureKeys" error.
I have already added the given dependency:
<!-- https://mvnrepository.com/artifact/net.sf.saxon/Saxon-HE -->
<dependency>
<groupId>net.sf.saxon</groupId>
<artifactId>Saxon-HE</artifactId>
<version>10.6</version>
</dependency>
Please help me out to resolve this issue.
I think you want import net.sf.saxon.lib.FeatureKeys, see https://www.saxonica.com/html/documentation10/javadoc/net/sf/saxon/lib/FeatureKeys.html
I am implementing a module for Java11 and want to use annotations from JSR250 (javax.annotation.PostConstruct and javax.annotation.PreDestroy).
I already changed the according dependency from:
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>jsr250-api</artifactId>
<version>1.0</version>
</dependency>
to this:
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.3.2</version>
</dependency>
That artifact javax.annotation-api-1.3.2.jar contains in META-INF/MANIFEST.MF this line:
Automatic-Module-Name: java.annotation
Hence, I tried to add this to my module-info.java file:
requires java.annotation;
However, I get an error for this import:
import javax.annotation.PostConstruct;
The error message is:
The type javax.annotation.PostConstruct is not accessible
I already studied the following related questions but am still unable to resolve my issue:
I can't use #PostConstruct and #PostDestroy with Java 11
Intellij: how to add java.annotation module for javax.annotation.PostConstruct (Please note that I am using Eclipse with JDK11 and that does not contain a module java.xml.ws.annotation).
The error occurred only in Eclipse.
It actually turned out that other unrelated compile errors where causing some side effects in Eclipse. After resolving those and refreshing and cleaning the project the described error magically disappeared.
Special thanks to #howlger and #Naman for pointing me in the right direction.
I want to try the example of dynamic update statement on this tutorial link : http://www.mybatis.org/mybatis-dynamic-sql/docs/update.html. I saw that it needs the import org.mybatis.dynamic.sql.update.render.UpdateStatementProvider; , So i've searched for dependency in the maven central and added below dependency on my pom.xml
<!-- https://mvnrepository.com/artifact/org.mybatis.dynamic-sql/mybatis-dynamic-sql -->
<dependency>
<groupId>org.mybatis.dynamic-sql</groupId>
<artifactId>mybatis-dynamic-sql</artifactId>
<version>1.0.0</version>
</dependency>
Already tried mvn clean install -U on maven build but still The import org.mybatis.dynamic cannot be resolved error always shows. Where can i have the correct maven dependency for this. Or you can suggest me other dynamic update statement approach on mybatis using xml mapper.
I also added the newest version of it and everything worked as expected. I had the problem, that mybatis-spring-boot-starter did not include mybatis-dynamic-sql.
<dependency>
<groupId>org.mybatis.dynamic-sql</groupId>
<artifactId>mybatis-dynamic-sql</artifactId>
<version>1.3.1</version>
</dependency>
I'm using a program that relies on the following two imports:
import org.lwjgl.opencl.CLDevice;
import org.lwjgl.opencl.CLPlatform;
Eclipse is reporting that the "import cannot be resolved" even though I've added LWJGL OpenCL as a dependency to my project.
Here's a snapshot of my POM file:
<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl-opencl</artifactId>
<version>3.1.6</version>
</dependency>
I've read somewhere that these classes only exist in an earlier version so I tried changing the version to all of the versions found here ( from 3.1.0 to 3.1.6) but none of them resolved the issue.
Is there an earlier/different version that is not on the Maven repository page? If not where could I find the said class?
Thanks
It seems that you are using the abandoned lwjgl v2 library. It can be found in another Maven repository:
<dependency>
<groupId>org.lwjgl.lwjgl</groupId>
<artifactId>lwjgl</artifactId>
<version>2.9.3</version>
</dependency>
Following run time error is coming:
javax/servlet/jsp/jstl/core/Config
Caused by:
java.lang.ClassNotFoundException - javax.servlet.jsp.jstl.core.Config
I have also downloaded jstl-1.2.jar and jsp-api-2.0.jar file still above error is not resolving. So please help me...
The first check that you IDE accolumate your project and coppy all liblriry in startUp folder. Very often users foregot that.
and check that you have this jar
maven
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
You need javax.servlet.jsp.jstl.jar file.
Download from here and include it in your project class path.