Hello i am new to gradle and have very little experience with it. I am trying to build NetworkTables to communicate between my Laptop and the roborio however when i type gradle build in my terminal i get this error
C:\Users\Desktop\GradleTest>gradle build
:compileJava
C:\Users\Desktop\GradleTest\src\main\com\djsprinkles\gradle\Main.java:3: error: package edu.wpi.first.wpilibj.networktables does not exist
import edu.wpi.first.wpilibj.networktables.NetworkTable;
^
C:\Users\Desktop\GradleTest\src\main\com\djsprinkles\gradle\Main.java:8: error: cannot find symbol
NetworkTable.setClientMode();
^
symbol: variable NetworkTable
location: class Main
C:\Users\Desktop\GradleTest\src\main\com\djsprinkles\gradle\Main.java:9: error: cannot find symbol
NetworkTable.setTeam(4525);
^
symbol: variable NetworkTable
location: class Main
C:\Users\Desktop\GradleTest\src\main\com\djsprinkles\gradle\Main.java:10: error: cannot find symbol
NetworkTable.initialize();
^
symbol: variable NetworkTable
location: class Main
C:\Users\Desktop\GradleTest\src\main\com\djsprinkles\gradle\Main.java:11: error: cannot find symbol
NetworkTable table = NetworkTable.getTable("Test");
^
symbol: class NetworkTable
location: class Main
C:\Users\Desktop\GradleTest\src\main\com\djsprinkles\gradle\Main.java:11: error: cannot find symbol
NetworkTable table = NetworkTable.getTable("Test");
^
symbol: variable NetworkTable
location: class Main
6 errors
:compileJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 1.488 secs
if anyone has a fix for this please tell me and also here is my gradle code keep in mind I’m new to gradle and may be missing something obvious
repositories{
maven {
url "http://first.wpi.edu/FRC/roborio/maven/release"
}
}
apply plugin: 'java'
dependencies{
compile "edu.wpi.first.wpilib.networktables.java:NetworkTables:3.1.5"
}
sourceSets{
main.java.srcDir "src/main"
test.java.srcDir "src/test"
}
jar{
manifest.attributes "Main-Class": "main.net.djsprinkles.gradle.Main"
}
and my code
package main.com.djsprinkles.gradle;
import edu.wpi.first.wpilibj.networktables.NetworkTable;
public class Main {
public static void main(String] args) {
NetworkTable.setClientMode();
NetworkTable.setTeam(4525);
NetworkTable.initialize();
NetworkTable table = NetworkTable.getTable("Test");
table.putNumber("X", 5);
}
}
Thanks any help is appreciated.