View Single Post
  #3   Spotlight this post!  
Unread 01-30-2016, 05:21 PM
ckirschner ckirschner is offline
Registered User
FRC #0869
 
Join Date: Jan 2016
Location: New Jersey
Posts: 9
ckirschner is an unknown quantity at this point
Re: Using joystick buttons with Command based programming

Quote:
Originally Posted by Guy997 View Post
Instead of putting

in init, make a function public OI in OI.

Code:
public OI(){
joystickButtonA.whenPressed(new shiftDriveSpeed());
}
When I do that and I deploy I get no RobotCode and I see this error in the console:
Code:
ERROR Unhandled exception: java.lang.ExceptionInInitializerError at [org.usfirst.frc.team869.robot.Robot.robotInit(Robot.java:42), edu.wpi.first.wpilibj.IterativeRobot.startCompetition(IterativeRobot.java:72), edu.wpi.first.wpilibj.RobotBase.main(RobotBase.java:241)]ERROR Unhandled exception: java.lang.ExceptionInInitializerError at [org.usfirst.frc.team869.robot.Robot.robotInit(Robot.java:42), edu.wpi.first.wpilibj.IterativeRobot.startCompetition(IterativeRobot.java:72), edu.wpi.first.wpilibj.RobotBase.main(RobotBase.java:241)]

When I remove that code I get RobotCode and can still use the drive train however I see this in the console:
Code:
 Exception in thread "main" java.lang.NoClassDefFoundError: edu/wpi/first/wpilibj/internal/HardwareTimer 
 	at java.lang.ClassLoader.loadClass(ClassLoader.java:424) 
 ERROR Unhandled exception: java.lang.ExceptionInInitializerError at [org.usfirst.frc.team869.robot.Robot.robotInit(Robot.java:42), edu.wpi.first.wpilibj.IterativeRobot.startCompetition(IterativeRobot.java:72), edu.wpi.first.wpilibj.RobotBase.main(RobotBase.java:241)] 
 WARNING: Robots don't quit! 
 WARNING: Robots don't quit! 
 ---> The startCompetition() method (or methods called by it) should have handled the exception above. 
 	at java.net.URLClassLoader$1.run(URLClassLoader.java:372) 
 ➔ Launching «'/usr/local/frc/JRE/bin/java' '-jar' '/home/lvuser/FRCUserProgram.jar'» 
 platform: /Linux/arm/ 
 ➔ Launching «'/usr/local/frc/JRE/bin/java' '-jar' '/home/lvuser/FRCUserProgram.jar'» 
 ➔ Launching «'/usr/local/frc/JRE/bin/java' '-jar' '/home/lvuser/FRCUserProgram.jar'» 
 ERROR Unhandled exception: java.lang.ExceptionInInitializerError at [org.usfirst.frc.team869.robot.Robot.robotInit(Robot.java:42), edu.wpi.first.wpilibj.IterativeRobot.startCompetition(IterativeRobot.java:72), edu.wpi.first.wpilibj.RobotBase.main(RobotBase.java:241)] 
 NT: server: client CONNECTED: 10.8.69.221 port 60331

So when I modify it with what you mentioned it breaks it, however there may be something underlying in my code that's ultimately causing that issue.
Reply With Quote