简体   繁体   中英

Eclipse doesn't resolve classes from external jar

I have a service project that I build and added the jar into my other projects libs folder.

在此处输入图片说明

I have added the jar gradle.build

flatDir { dirs 'libs' }
compile('com.vadr:vadr-aps-client:0.0.1-SNAPSHOT')

The jar added to class path and visible in Project and External dependencies folder 在此处输入图片说明

But still I cannot build the app and Eclipse also showing cannot be resolved to a type errors for the classes I have in external jar. Externel jar is build with gradle(gradlew build)

Put the jar in some resource folder say src/main/resources/lib . In your build.gradle add following:

dependencies {
.
.
.
    compile files('src/main/resources/lib/vadr-aps-client-0.0.1-SNAPSHOT.jar')
.
.
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM