Why isn't my sound working anymore

ok so I have this sound code I use for all my stuff I need sound in, I used it last about 1 or 2 months ago and it worked, I had it in 2 applications that unfortunatley I don’t have anymore and it worked it played sound and I could make it loop and wahtever I wanted

but now it has stopped working, it doesn’t generate any errors it just doesn’t play the sound, I checked if it is running the code and it is I’ve tried running it in a new application and I tried a new thread in the current application and nothing worked

here’s the code

import java.net.URL;

import javax.sound.midi.*;

public class Music {

	public Music() {
		Thread t = new Thread(new Runnable() {
			@Override
			public void run() {
				pplay();
			}
		});t.start();
	}
	
	public void pplay() {
		// TODO Auto-generated method stub
		try {
			URL url = new URL("file:c:/theme.mid");
			System.out.println("Started");
			sequence = MidiSystem.getSequence(url);
			sequencer = MidiSystem.getSequencer();

			sequencer.open();
			sequencer.setSequence(sequence);

			sequencer.start();
			System.out.println("Done");
		} catch(Exception e) {
			e.printStackTrace();
		}	
	}

	public static Sequence sequence;
	public static Sequencer sequencer;
}

I just want to know if I’m missing something, or is there something wrong with my java nothing has changed since I last used this code

The “sound chain” involves code both in Java and in the OS. Has anything changed outside of Java, in your OS or computer, that might account for this?

Can you execute a dump of the MIDI data? (Verify that the data is actually there, and a sequencer instance is actually there, etc.)

I’m more experienced with the javax.sound.sampled end of things, not MIDI. There was one change when we went to Java 7 that had an effect (involving InputStreams), but it doesn’t apply to your situation, afaik. So, am just suggesting some basic troubleshooting.

The MIDI synthesizer changed completely between Java 6 and Java 7. If you’ve upgraded since you last used this code then that could be the reason. You might have to try the methods that let you set the synthesiser manually and see if any work as you’re expecting.

oh ya I just tried using java 7 to compile it with and the sound plays yay, but one problem, if I have this precompiled with java 7 will someone who is using java 6 be able to hear the music or will it not work?

No.
And as far as i’m concerned, it will greet you with an Exception

Java 7 is indeed not bytecode compatible with Java 6 - you can’t run applications built for Java 7 on a Java 6 runtime.