eclipse - The import javax.inject cannot be resolved while import Guava source -
i use guava's typetoken, downloaded guava release 14.0 here. (i assume 14.0 more stable 15.0 rc.)
guava-14.0.1-sources.jar (source) http://search.maven.org/remotecontent?filepath=com/google/guava/guava/14.0.1/guava-14.0.1-sources.jar unzip downloaded guava-14.0.1-sources.jar folder.
then created java 1.7 project in eclipse.
and linked source in eclipse java build path -> source -> link source....
note not using (and don't know how use) build systems maven.
first got problem of the import javax.annotation.nullable cannot resolved. but solved already. followed thread here download jsr305-2.0.1.jar this page. (i assume 2.0.1 latest release.)
secondly got rt.jar access restriction problem this one. this solved re-add jre system library, answer there.
now got problem cannot solve, , there no solutions web.
in package com.google.common.util.concurrent class servicemanager, there few compile errors.
import javax.inject.inject; // import javax.inject cannot resolved import javax.inject.singleton; // import javax.inject cannot resolved to understanding, similar problem "first problem". jsr305-2.0.1.jar includes javax.annotation.nullable, not include javax.inject.*. need java library includes javax.inject.*.
could please help? lot!
the javax.inject package provided in java ee. if you're needing use in java se reason, can explicitly include jar api interfaces in it. maven central has link implementation (javax.inject:javax.inject). using maven make life simpler, can download jar file , include manually.
Comments
Post a Comment