Simulation Bug for 2025 CTRE Beta

Hi! We’ve been updating our codebase to 2025, so we can get a little ahead for our software team this year. We’re having trouble with CTRE Phoenix 6’s dependency, where it will build correctly, but fail to simulate, throwing these errors:

********** Robot program starting **********
java.lang.UnsatisfiedLinkError: no CTRE_PhoenixTools in java.library.path: ..\build\jni\release
java.lang.UnsatisfiedLinkError: ..\build\jni\release\CTRE_PhoenixTools_Sim.dll: A dynamic link library (DLL) initialization routine failed
java.lang.UnsatisfiedLinkError: no CTRE_PhoenixTools_Replay in java.library.path: ..\build\jni\release

We’ve attempted looking into that release folder, and found that it didn’t have CTRE_PhoenixTools, only the Sim one. What could cause this? We’ve tried it on multiple computers, all with the newest WPILIB (2025.1.1 Beta 1). I’ve also attempted using their “Phoenix 6 Replay” dependency, both on it’s own and WITH Phoenix 6 (which doesn’t work according to CTRE docs) and it has the same error. Is this an issue on CTRE’s end?

If it helps, we’re on CTRE verison 25.0.0-beta-2 “CTRE-Phoenix (v6)”

This happens if you’re launching sim with an incorrect Java runtime. Are you launching from vscode, or some other method? If you’re launching with another method, do you know where it’s picking up Java from?

I’m launching from VSCode, installed using the installer from the WPILib Beta. It’s using jdk-17

Ok. This should be fixed fully in wpilib beta 2 When we release it. What is happening is somehow vscode is picking up your locally installed jvm. You can work around this right now theoretically by running ./gradlew simulateJava from the terminal in vscode. It won’t work from a non vs code terminal.

Purely out of curiosity… would it work if you first setup your non-vscode terminal so the wpilib jdk is on the path? Or are there other configurations that VSCode sets that would be relevant?

Yes, that would work too.

1 Like

The other option is to update your personal jdk to the newest release of adoptium jdk. It’s an issue with the msvc runtime included with any jdk shipped before may 2024 and potentially later.