Com.ctre.phoenix not working! please help?!?!

java.lang.UnsatisfiedLinkError: no CTRE_PhoenixCCI in java.library.path: [C:\Program Files\Zulu\zulu-11\bin, C:\WINDOWS\Sun\Java\bin, C:\WINDOWS\system32, C:\WINDOWS, C:\Windows\system32, C:\Windows, C:\Windows\System32\Wbem, C:\Windows\System32\WindowsPowerShell\v1.0\, C:\Windows\System32\OpenSSH\, C:\Program Files
(x86)\NVIDIA Corporation\PhysX\Common, C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR, C:\Program Files\Intel\WiFi\bin\, C:\Program Files\Common Files\Intel\WirelessCommon\, C:\WINDOWS\system32, C:\WINDOWS, C:\WINDOWS\System32\Wbem, C:\WINDOWS\System32\WindowsPowerShell\v1.0\, C:\WINDOWS\System32\OpenSSH\, C:\Program Files\Zulu\zulu-11\bin\, C:\Users\NAME\AppData\Local\Programs\Python\Python37-32\Scripts\, C:\Users\NAME\AppData\Local\Programs\Python\Python37-32\, C:\Users\NAME\AppData\Local\Microsoft\WindowsApps, C:\Users\NAME\AppData\Local\atom\bin, C:\Users\NAME\AppData\Local\Programs\Microsoft VS Code Insiders\bin, C:\Users\Public\frc2019\frccode, C:\Users\NAME\AppData\Local\Programs\Microsoft VS Code\bin, .]
        at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2660)
        at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:829)
        at java.base/java.lang.System.loadLibrary(System.java:1867)
        at com.ctre.phoenix.CTREJNIWrapper.<clinit>(CTREJNIWrapper.java:9)
        at com.ctre.phoenix.motorcontrol.can.BaseMotorController.<init>(BaseMotorController.java:57)
        at com.ctre.phoenix.motorcontrol.can.VictorSPX.<init>(VictorSPX.java:27)
        at frc.robot.Test.main(Test.java:10)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at jdk.compiler/com.sun.tools.javac.launcher.Main.execute(Main.java:404)
        at jdk.compiler/com.sun.tools.javac.launcher.Main.run(Main.java:179)
        at jdk.compiler/com.sun.tools.javac.launcher.Main.main(Main.java:119)

Someone, please explain what this means and how to fix it.

You’re trying to run your robot program (that uses Phoenix) on the desktop. Phoenix does not provide the libraries to do this, so you’re getting an error when the Java program tries to load the library at runtime. Did you mean to deploy the program to the robot instead?

2 Likes

So, you are saying the code only works on the RoboRIO? we can’t just make a script to see if works on our desktop?

Your hooking a PDB, TalonSRX or Victor up to your desktop? :eyes:

1 Like

no, I just have a small script on my computer and was trying to run it.

What’s the script? WPILib specifically targets the roboRIO and some other ARM platforms. There is no reason for it to work on a desktop as there isn’t an easy way nor a reason to hook CAN or PWN devices directly to a desktop. Are you trying to run in simulation? If so, you can just use ./gradlew simulateJava. You can’t directly run Main.java

oh, okay thanks everyone!

Just as a follow up, simulating an FRC program that contains Phoenix objects will run as normal (when using gradlerio/vscode to simulate). You will see errors and warnings in the program output as if there are no devices on the CAN bus, this is normal.

1 Like