简体   繁体   中英

Unable to load class from installed jar in maven

I installed by jar file inside of my maven local repository (~/.m2/repository/) by following the tutorial of the 3rd party JARs installation with the groupID, artifactId, version and packaging like this:

mvn install:install-file -Dfile=CAENRFIDLibrary.jar -DgroupId=com.caen -DartifactId=RFIDLibrary -Dversion=4.7.0-SNAPSHOT -Dpackaging=jar.

After updating maven project dependency inside eclipse, the error that appears in my pom.xml disappears. But in my program, I'm not able to load class from jar file. (NB: The package is imported in the program)

Did someone know how to solve this problem?

Thanks in advance for your help.

Update dependency like below in pom file.

<dependency>
     <groupId>com.caen</groupId>
     <artifactId>CAENRFIDLibrary</artifactId>
     <version>4.7.0</version>
</dependency>

I did by using the right way but it persists always. I am asking myself if the problem is not coming from the jar because it is generate with Ant 1.9.4? May be it is coming from the groupId as the package where all the classes are located is "com.caen.RFIDLibrary"

The problem is solved, the problem is due to the rxtxcomm jar's file. By trying to load both, CAENRFIDLibrary.jar and rxtxcomm.jar, step-by-step as external lib of the project I found the solution.

Thanks your helps.

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