New to Java, Trying to Deploy Code

Ok so I am switching to Java and I am trying to deploy the code to the Robot. I have JRE installed on the Robot using the WPI Tool and I have the Code. When I go to “Run as” as per ScreenSteps it seems that everything is working fine, I get build successful but I do not get the Robot Code Green Light on the Dashboard, the dashboard is connected to the Robot, I am using USB to communicate with the robot in this process.

The lights on the RoboRIO are as follows: Power: Green (Given), Status: off, Radio: off, COMM: Red, Mode: off.
Note: the COMM light flashes ever once in a while. I also can access the Web GUI on the USB IP: 172.22.11.2.

The Console information:


Buildfile: C:\Users\robotics1\Documents\GitHub\5420-JAVA-Code-ROBOT-2015\build.xml
Trying to override old definition of task classloader
clean:
   [delete] Deleting directory C:\Users\robotics1\Documents\GitHub\5420-JAVA-Code-ROBOT-2015\build
   [delete] Deleting directory C:\Users\robotics1\Documents\GitHub\5420-JAVA-Code-ROBOT-2015\dist
compile:
    [mkdir] Created dir: C:\Users\robotics1\Documents\GitHub\5420-JAVA-Code-ROBOT-2015\build
     [echo] [athena-compile] Compiling src with classpath=C:\Users\robotics1\wpilib\java\current\lib\WPILib.jar;C:\Users\robotics1\wpilib\java\current\lib\NetworkTables.jar;C:\Users\robotics1\wpilib\java\current\lib\opencv.jar;C:\Users\robotics1\wpilib\java\current\lib\cscore.jar to build
    [javac] Compiling 5 source files to C:\Users\robotics1\Documents\GitHub\5420-JAVA-Code-ROBOT-2015\build
jar:
     [echo] [athena-jar] Making jar dist/FRCUserProgram.jar.
    [mkdir] Created dir: C:\Users\robotics1\Documents\GitHub\5420-JAVA-Code-ROBOT-2015\dist
    [mkdir] Created dir: C:\Users\robotics1\Documents\GitHub\5420-JAVA-Code-ROBOT-2015\build\jars
     [echo] [athena-jar] Copying jars to build/jars.
     [copy] Copying 4 files to C:\Users\robotics1\Documents\GitHub\5420-JAVA-Code-ROBOT-2015\build\jars
      [jar] Building jar: C:\Users\robotics1\Documents\GitHub\5420-JAVA-Code-ROBOT-2015\dist\FRCUserProgram.jar
get-target-ip:
     [echo] Finding roboRIO, please ignore any [hostinfo] error messages
     [echo] Trying USB: 172.22.11.2
     [echo] Trying DNS: roboRIO-5420-FRC.lan
     [echo] Trying mDNS: roboRIO-5420-FRC.local
     [echo] Trying mDNS: roboRIO-5420-FRC.frc-robot.local
     [echo] Trying Static Ethernet: 10.54.20.2
     [echo] roboRIO found at 172.22.11.2
dependencies:
 [hostinfo] Error retrieving remote host information for host:roboRIO-5420-FRC.frc-robot.local.
 [hostinfo] Error retrieving remote host information for host:roboRIO-5420-FRC.lan.
     [echo] roboRIO image version validated
     [echo] Checking for JRE. If this fails install the JRE using these instructions: https://wpilib.screenstepslive.com/s/4485/m/13503/l/288822-installing-java-8-on-the-roborio-using-the-frc-roborio-java-installer-java-only
  [sshexec] Connecting to 172.22.11.2:22
  [sshexec] cmd : test -d /usr/local/frc/JRE
deploy:
   [delete] Deleting: C:\Users\robotics1\wpilib\java\current\lib
ative\lib\WPI_Native_Libraries.properties
      [scp] Connecting to 172.22.11.2:22
      [scp] Receiving file: /usr/local/frc/lib/WPI_Native_Libraries.properties
      [scp] Receiving: WPI_Native_Libraries.properties : 2680
      [scp] File transfer time: 0.01 Average Rate: 446,666.67 B/s
      [scp] done
      [scp] Connecting to 172.22.11.2:22
      [scp] Receiving file: /usr/local/frc/lib/User_Libraries.properties
      [scp] Caught exception: scp: /usr/local/frc/lib/User_Libraries.properties: No such file or directory
     [echo] [athena-deploy] Copying code over.
      [scp] Connecting to 172.22.11.2:22
      [scp] done.
  [sshexec] Connecting to 172.22.11.2:22
  [sshexec] cmd : ldconfig
  [sshexec] Connecting to 172.22.11.2:22
  [sshexec] cmd : killall -q netconsole-host || :
   [delete] Deleting: C:\Users\robotics1\wpilib\java\current\ant
etconsole-host.properties
      [scp] Connecting to 172.22.11.2:22
     [echo] Resolved mDNS to 172.22.11.2
      [scp] Receiving file: /usr/local/frc/bin/netconsole-host.properties
      [scp] Receiving: netconsole-host.properties : 132
      [scp] File transfer time: 0.0 Average Rate: 132,000.0 B/s
      [scp] done
      [scp] Connecting to 172.22.11.2:22
      [scp] done.
     [echo] [athena-deploy] Starting program.
  [sshexec] Connecting to 172.22.11.2:22
  [sshexec] cmd : . /etc/profile.d/natinst-path.sh; /usr/local/frc/bin/frcKillRobot.sh -t -r;
  [sshexec] Connecting to 172.22.11.2:22
  [sshexec] cmd : sync
BUILD SUCCESSFUL
Total time: 9 seconds

Versions:


DS:  17.0.1
RIO:  FRC_roboRIO_2017_v8
Lib:  Java 2017.3.1
PCM:  1.65
PDP:  1.40

Anything can help, Thanks Noah.

We would be able to help you more easily if you post your code so we can look at it. :slight_smile:

The Code for the Robot

Ok, I have found the Error, Because its me and another Person making this program, I overlooked that they added an encoder on the same DIO port on line 43 (conflicts with line 47). I am now Getting a COMM: Green and a RobotCode that is Green too.

I am still getting the Dirrectory not found in the Console


      ...
      [scp] Caught exception: scp: /usr/local/frc/lib/User_Libraries.properties: No such file or directory
      ...

Thanks for the Efforts of trying to fix a mistake that I have made. Sorry for wasting some of your time.

IIRC this is normal and can be disregarded.

Ah, the best way to handle errors.


catch (Exception e){}

The reason this is ignored is that file only exists if 3rd party libraries are used. We always check for the existence of that file, but its not guaranteed to exist, and not necessary for deploy to work.

Can anyone help me learn how to code java. New to it and am not understanding anything.

Send me a Message and I can see what time I have to Help you.