简体   繁体   English

未解析的外部库导入包含类路径中的属性文件

[英]Unresolved import of external library with properties file in classpath

I'm working with usb4java at the high level following this demo: http://usb4java.org/quickstart/javax-usb.html . 我在这个演示之后在高级别使用usb4java: http ://usb4java.org/quickstart/javax-usb.html。 My issue is that we need javax.usb.properties in the classpath, so I've put it in the src directory. 我的问题是我们需要在类路径中使用javax.usb.properties,所以我把它放在src目录中。 I've also loaded up the .jars into a lib directory and added them to the referenced libraries. 我还将.jars加载到lib目录中,并将它们添加到引用的库中。 After all of this when importing "javax.usb.*" I'm getting an import cannot be resolved error and none of the types are accepted. 完成所有这一切后,导入“javax.usb。*”我得到导入无法解决错误,并且没有接受任何类型。

Note: the properties file is populated with: "javax.usb.services = org.usb4java.javax.Services" as instructed. 注意:属性文件填充有:“javax.usb.services = org.usb4java.javax.Services”,如说明。

Thoughts? 思考?

I think you need to add to the CLASSPATH also the JSR080 (javax.usb API). 我认为您还需要向CLASSPATH添加JSR080(javax.usb API)。 Where the javax.usb interface is defined. 定义javax.usb接口的位置。 You can download from here: http://javax-usb.sourceforge.net/ 你可以从这里下载: http//javax-usb.sourceforge.net/

I have checked and it looks the javax.usb API is included under lib folder in the usb4java-javax distribution: http://nexus.ailis.de/content/groups/public/org/usb4java/usb4java-javax/1.2.0/usb4java-javax-1.2.0.zip it is called usb-api.jar 我已经检查过,看起来javax.usb API包含在usb4java-javax发行版的lib文件夹下: http ://nexus.ailis.de/content/groups/public/org/usb4java/usb4java-javax/1.2.0 /usb4java-javax-1.2.0.zip它叫做usb-api.jar

Then make sure the javax.usb.properties file is on the root of your application CLASSPATH. 然后确保javax.usb.properties文件位于应用程序CLASSPATH的根目录下。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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