title: Audio works within Eclipse but not in .jar
body: <p>The following code does work great when run from within eclipse. But when I export it to a .jar file and try running from the jar, the audio plays for half a sec, and its about 3 seconds long.  The sound files are not located in the jar.  I obtain a path using System.getProperties("user.home") + PathToAudioFile;  Here is my current segment of code:</p>
  
  <pre><code>public void postFloorLoc(String FloorLoc)
  {   String audiopath = System.getProperty("user.home") + "/BortechData/audio/";
  
      txtFloorLocation.setText(FloorLoc);
      //choosing which file to play
      if(FloorLoc.contentEquals("1-FIFO"))
          audiopath = audiopath + "1-fifo.wav";
      if(FloorLoc.contentEquals("10-FIFO"))
          audiopath = audiopath + "10-fifo.wav";
      aufile = new File(audiopath);
      if(FloorLoc.contentEquals("1-FIFO") || FloorLoc.contentEquals("10-FIFO"))
      {   Thread t = new Thread(new Runnable(){
  
          @Override
          public void run() {
              try {
                  Line.Info linfo = new Line.Info(Clip.class);
                  Line line = AudioSystem.getLine(linfo);
                  Clip auClip = (Clip)line;
                  AudioInputStream ais = AudioSystem.getAudioInputStream(aufile);
                  auClip.open(ais);
                  auClip.setFramePosition(0);
                  auClip.start();
              }
              catch(UnsupportedAudioFileException uae)
              { JOptionPane.showMessageDialog(null, uae); }
              catch(IOException ioe)
              { System.out.println(ioe); }
              catch(LineUnavailableException lua)
              { System.out.println(lua); }
  
              }
  
          }); 
          t.start();
  
      }
  }
  </code></pre>
  
  <p>All other requests for help have about the same thing.  Again this works great within eclipse, but as a jar I only get half of a second of audio out of about 3 seconds.  So, its finding the file and starts to play it but does not play all of it.  What am I missing???</p>