If you're using a Spike Relay, then the signal cable should be connected to a Relay port on the sidecar, not a DIO port.
In your code, you'll want to use the Relay class. You use the Relay#set() method to control the output of the relay:
Code:
// Create the relay
Relay ledRelay = new Relay(RELAY_PORT);
// Control the relay
ledRelay.set(Relay.Value.kOn);
ledRelay.set(Relay.Value.kOff);