Hellomy 0 Newbie Poster

So I am using a Clip to play a wav file that is in the resource, it works perfectly when I am running the application through eclipse, but when I export it as a Jar/Runnable Jar, the sounds will not play. I know it is not a resource problem because the images inside the jar will load up perfectly fine. Any help?

Line.Info linfo = new Line.Info(Clip.class);
	        Line line;
		try
		{
		    line = AudioSystem.getLine(linfo);
		    clip = (Clip) line;
		    AudioInputStream ais = AudioSystem.getAudioInputStream(soundFile);
		    clip.open(ais);
		    clip.start();
		}
		catch (LineUnavailableException e)
		{
			e.printStackTrace();
		}
		catch (IOException e)
		{
			e.printStackTrace();
		}
		catch (UnsupportedAudioFileException e)
		{
			e.printStackTrace();
		}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.