在linux上获取java.lang.ClassNotFoundException:javazoom.jl.decoder.JavaLayerException但在windows上运行

时间:2014-11-10 23:01:33

标签: java linux mp3 raspberry-pi jlayer

我正在使用JLayer播放mp3文件

使用该命令将项目编译到jar后,以下代码可以正常工作 java - jar blahblahblah.jar

但不是linux ....任何想法?我得到java.lang.ClassNotFoundException:javazoom.jl.decoder.JavaLayerException

import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import javazoom.jl.decoder.JavaLayerException;
import javazoom.jl.player.Player; 
public class Mp3JLayerTest 
{

/**
 * @param args the command line arguments
 */
String filename;
String directory;
File mp3File;
static Player player;
public static void main(String[] args) throws FileNotFoundException, JavaLayerException 
{
        FileInputStream fis;
        fis = new FileInputStream("kalimba.mp3");
        BufferedInputStream bis = new BufferedInputStream(fis);
        player = new Player(bis);
        player.play();
        new Thread((Runnable) new Mp3JLayerTest()).start();

}

public void run() throws JavaLayerException 
{ 
    player.play();
}

}

0 个答案:

没有答案