Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make runtime loader exception message slightly better #7536

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

ThadHouse
Copy link
Member

Now always includes the JVM location, and a link to the new docs page (page still WIP)

@github-actions github-actions bot added the component: wpiutil WPI utility library label Dec 10, 2024
@ThadHouse
Copy link
Member Author

If I disable the mutex workaround added to wpiutil, I now get the following log.

> Task :developerRobot:run FAILED
java.io.IOException: wpiutiljni could not be loaded from path.
        attempted to load for platform /windows/x86-64/
Last Load Error:
C:\Users\thadh\Documents\GitHub\thadhouse\allwpilib\developerRobot\build\install\developerRobotCpp\windowsx86-64\lib\wpiutiljni.dll: A dynamic link library (DLL) initialization routine failed
JVM Location: C:\Users\thadh\Downloads\OpenJDK17U-jdk_x64_windows_hotspot_17.0.9_9\jdk-17.0.9+9\bin\java.exe
A common cause of this error is using a JVM with an incorrect MSVC runtime.
Ensure you are using the WPILib JVM (The current running JVM is listed above
See https://wpilib.org/jvmruntime for more information

        at edu.wpi.first.util.RuntimeLoader.loadLibrary(RuntimeLoader.java:47)
        at edu.wpi.first.util.WPIUtilJNI.<clinit>(WPIUtilJNI.java:44)
        at edu.wpi.first.wpilibj.RobotBase.startRobot(RobotBase.java:470)
        at frc.robot.Main.main(Main.java:18)

If the mutex workaround in wpiutil is there, this is the log

> Task :developerRobot:run FAILED
Exception in thread "main" edu.wpi.first.util.MsvcRuntimeException: Invalid MSVC Runtime Detected.
Expected at least 14.40, but found 14.29
JVM Location: C:\Users\thadh\Downloads\OpenJDK17U-jdk_x64_windows_hotspot_17.0.9_9\jdk-17.0.9+9\bin\java.exe
Runtime DLL Location: C:\Users\thadh\Downloads\OpenJDK17U-jdk_x64_windows_hotspot_17.0.9_9\jdk-17.0.9+9\bin\msvcp140.dll
See https://wpilib.org/jvmruntime for more information

        at edu.wpi.first.util.WPIUtilJNI.checkMsvcRuntime(Native Method)
        at edu.wpi.first.wpilibj.RobotBase.startRobot(RobotBase.java:470)
        at frc.robot.Main.main(Main.java:18)

Either way, both now have the JVM location.

PeterJohnson
PeterJohnson previously approved these changes Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: wpiutil WPI utility library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants