I am uploading midis to my server and I would like to have the server find out what the length of the midi is in seconds. I need a command line utility which will return the length.

I know nothing at all about java programming or how to run a java program.

I found this:
How to determine the duration of a Midi audio file

This Java tip illustrates a method of determining the duration of a Midi audio file. Developer may use this in gaming applications where there is a need for playing different audios. Further this may also be used in your own media player. Here in this tip a sequencer fires a meta message event when a midi file has finished playing.
// From file
Sequence sequence = MidiSystem.getSequence(new File("midiaudiofile"));

// From URL
sequence = MidiSystem.getSequence(new URL("http://hostname/midiaudiofile"));

// Create a sequencer for the sequence
Sequencer sequencer = MidiSystem.getSequencer();

double durationInSecs = sequencer.getMicrosecondLength() / 1000000.0;
This looks like it might work but I don't have a clue how I would call, compile or whatnot on my server to get an executable program.

Any help would be appreciated,