2017-02-13 63 views
0

我試圖在gazebosim中運行一些基本的代碼,項目建立良好,但一旦它連接到涼亭我得到的錯誤「線程中的異常」主「java.lang.UnsatisfiedLinkError:沒有ntcore在java.library.path」線程「main」中的異常java.lang.UnsatisfiedLinkError:java.library.path中沒有ntcore?

我已經找到了文件ntcore.so與-Djava'library.path

target name="simulate" depends="jar-for-simulation"> 
<sequential> 
    <echo>[simulate] You may now run Gazebo and your DriverStation</echo> 
    <echo>[simulate] Running Code.</echo> 
    <java jar="${simulation.dist.jar}" fork="true"> 
     <jvmarg value="-Djava.library.path={/home/alex/wpilib/java/current/lib/native/lib/libntcore.so}" /> 
    </java> 
</sequential> 

任何想法sepcified它的位置?這是推動我控制檯的瘋狂

輸出:

Buildfile: /home/alex/workspace/TestRobo/build.xml 
Trying to override old definition of task classloader 
compile: 
[echo] [athena-compile] Compiling src with classpath=/home/alex/wpilib/java/current/lib/WPILib.jar:/home/alex/wpilib/java/current/lib/NetworkTables.jar:/home/alex/wpilib/java/current/lib/opencv.jar:/home/alex/wpilib/java/current/lib/cscore.jar to build 
jar-for-simulation: 
[echo] [jar-for-simulation] Building jar. 
    [jar] Building jar: /home/alex/workspace/TestRobo/dist/FRCUserProgramSim.jar 
simulate: 
[echo] [simulate] You may now run Gazebo and your DriverStation 
[echo] [simulate] Running Code. 
[java] Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
[java] resources = |[email protected]| 
[java] platform: /Linux/i386/ 
[java] Exception in thread "main" java.lang.UnsatisfiedLinkError: no ntcore in java.library.path 
[java]  at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1865) 
[java]  at java.lang.Runtime.loadLibrary0(Runtime.java:870) 
[java]  at java.lang.System.loadLibrary(System.java:1122) 
[java]  at edu.wpi.first.wpilibj.networktables.NetworkTablesJNI.<clinit>(NetworkTablesJNI.java:60) 
[java]  at edu.wpi.first.wpilibj.networktables.NetworkTable.initialize(NetworkTable.java:44) 
[java]  at edu.wpi.first.wpilibj.networktables.NetworkTable.getTable(NetworkTable.java:176) 
[java]  at edu.wpi.first.wpilibj.RobotBase.<init>(RobotBase.java:58) 
[java]  at edu.wpi.first.wpilibj.SampleRobot.<init>(SampleRobot.java:31) 
[java]  at org.usfirst.frc.team420.robot.Robot.<init>(Robot.java:29) 
[java]  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 
[java]  at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) 
[java]  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) 
[java]  at java.lang.reflect.Constructor.newInstance(Constructor.java:422) 
[java]  at java.lang.Class.newInstance(Class.java:442) 
[java]  at edu.wpi.first.wpilibj.RobotBase.main(RobotBase.java:190) 

回答

0

嘗試設置java.library.path圖書館所在的目錄,而不是庫本身。

<jvmarg value="-Djava.library.path=/home/alex/wpilib/java/current/lib/native/lib" /> 

(林不知道,如果{}是必需的或有問題的?)

0

的錯誤的原因可以是以下;

原因:

PATH變量不包括其中包含的Java類的功能所要求的本地庫的目錄。

解決方法:

在Windows或/和Unix平臺上,添加您的依賴關係到PATH變量。按照this文章,詳細瞭解

OR

你可以在Eclipse啓動配置

0

添加-Djava.library.path作爲VM參數我不是很久以前,有這種確切的問題。我解決這個問題的方法是通過編譯ntcore來源使用Gradle.

有關如何執行此操作的說明包含在ntcore的自述文件中。

相關問題