I got this error and I am not sure what is wrong

I got this coding error: no management in java.library.path: [/Users/dkaplan/Library/Java/Extensions, /Library/Java/Extensions, /Network/Library/Java/Extensions, /System/Library/Java/Extensions, /usr/lib/java, .]
and I am not sure why my code isn’t building. Please help.

Keep in mind that we unfortunately do not have context to what you are attempting to do, or how you got to the state where you are receiving that error. Error text rarely matches 1 for 1 with exact root cause issues. We’ll likely need a lot more details about what you have and have not tried to get to root cause.

To start: Have you followed the install instructions for WPILib ?

Note that you have linked the latest version of the documentation which contains information about the new installer for beta teams. To see the install process for 2020, please see the stable version of the documentation, available here: WPILib Installation Guide — FIRST Robotics Competition documentation

3 Likes

Good catch!

Derp - Had the latest docs up for other reasons, clicked the link and copied without thinking.

Thank you!

Thanks for the fast response
This is my code for the robot.java, I didn’t add the methods that didn’t have any code.
package frc.robot;

import edu.wpi.first.wpilibj.TimedRobot;
import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;

public class Robot extends TimedRobot {
private static final String kDefaultAuto = “Default”;
private static final String kCustomAuto = “My Auto”;
private String m_autoSelected;
private final SendableChooser m_chooser = new SendableChooser<>();

Input inputs = null;
RobotBase robotbase = null;
/**

  • This function is run when the robot is first started up and should be
  • used for any initialization code.
    */
    @Override
    public void robotInit() {
    m_chooser.setDefaultOption(“Default Auto”, kDefaultAuto);
    m_chooser.addOption(“My Auto”, kCustomAuto);
    SmartDashboard.putData(“Auto choices”, m_chooser);
    inputs = new Inputs();
    robotbase = new RobotBase();
    }

/**

  • This function is called every robot packet, no matter the mode. Use
  • this for items like diagnostics that you want ran during disabled,
  • autonomous, teleoperated and test.
  • This runs after the mode specific periodic functions, but before

  • LiveWindow and SmartDashboard integrated updating.
    */
    @Override
    public void robotPeriodic() {
    }

/**

  • This autonomous (along with the chooser code above) shows how to select
  • between different autonomous modes using the dashboard. The sendable
  • chooser code works with the Java SmartDashboard. If you prefer the
  • LabVIEW Dashboard, remove all of the chooser code and uncomment the
  • getString line to get the auto name from the text box below the Gyro
  • You can add additional auto modes by adding additional comparisons to

  • the switch structure below with additional strings. If using the
  • SendableChooser make sure to add them to the chooser code above as well.
    */
    @Override
    public void autonomousInit() {
    m_autoSelected = m_chooser.getSelected();
    // m_autoSelected = SmartDashboard.getString(“Auto Selector”, kDefaultAuto);
    System.out.println("Auto selected: " + m_autoSelected);
    }

/**

  • This function is called periodically during autonomous. Automous is without driver.
    */
    @Override
    public void autonomousPeriodic() {
    switch (m_autoSelected) {
    case kCustomAuto:
    // Put custom auto code here
    break;
    case kDefaultAuto:
    default:
    // Put default auto code here
    break;
    }
    }

/**

  • This function is called once when teleop is enabled. Teleop is with driver
    */
    @Override
    public void teleopInit() {
    }

/**

  • This function is called periodically during operator control.
    */
    @Override
    public void teleopPeriodic()
    {
    inputs.ReadValues();
    robotbase.Update();
    }

This is my code for Robotbase:
class RobotBase()
{
Talon bigmot1 = null;

public RobotBase() {   
    bigmot1 = new Talon(0);
    bigmot1.set(inputs.dDanielsMotorPower);
}
public void Update()
{
    bigmot1.set(inputs.dDanielsMotorPower);
}

}

This is my code for inputs
class Inputs
{
private XboxController gamepadOperator = null;
private XboxController gamepadDriver = null;
public Joystick joyTestController = null;

public double dDanielsMotorPower = 0.0;
public void ReadValues()
{
    if(gamepadOperator.getBButtonPressed())
    {
        dDanielsMotorPower = 0.15;
    }
    else 
    {
        dDanielsMotorPower = 0.00; 
    }

}

}

“management” (aka java.lang.management) is a class in the standard Java SDK/JRE.

I am guessing that

import java.lang.management;

might be the first import in WPILIB? In any event, it sounds like your Java environment is not (completely) installed (in the expected location). It is looking in the directories listed there in the error message you got.

1 Like

@DanTheBeginner Are you using macOS? I suspect you missed the step for “Setting up Visual Studio Code to use Java 11” in the install instructions above.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.