Title: getting java.lang.ClassNotFoundException: javazoom.jl.decoder.JavaLayerException on linux but works on windows
Tags: java;linux;mp3;raspberry-pi;jlayer
Question: I am using JLayer to play an mp3 file

the following code works after compiling the project into a jar with the command
java - jar blahblahblah.jar

but not with linux.... any ideas? I get  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();
}
```

}

Comment: I am attempting to run on raspberry pie with build 1.7.0_40-b43 on linux

Comment: just updated hopefully it will avoid confusion :)

Comment: windows 1.7_45 just checked if that helps, will continue to google and experiment, if I come up with an answer will post back

Comment: yes, within netbeans I have the added jar file and the class is present.

Comment: within windows I am using netbeans to add the jar to the project file compiling out the new jar project file and running via commandline in linux, that way the included jar is within the new compiled jar.... this works in windows by executing the runnable jar file by double clicking or running via command line.  in linux I transfer the compiled jar over and run via command line

Comment: windows yes, also commandline windows yes.....

Comment: when i move it over to my pi no

Comment: ill give it a shot and see how it goes

Comment: ended up going a different way with this using python and pygame for mp3 output/gpio control/tcp server and java for control with a Android application.

Comment: Your title says the contrary as your message

Comment: Did you check this class is in the jar ?

Comment: Wait... I thought you were running a jar with command line. What does Netbeans have to do with that ?

Comment: Well that last sentence probably is the problem. Try the same command in the folder where the jar was created. Also, can you run your project from NetBeans ?

Comment: What if you decompress the library jar so that the binary files are on the same level as your classes ? Build your project by hand



{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 0, 'CommentCount': 14, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2014:00:11/10/14', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<java><linux><mp3><raspberry-pi><jlayer>', 'Title': 'getting java.lang.ClassNotFoundException: javazoom.jl.decoder.JavaLayerException on linux but works on windows', 'ViewCount': 1194, 'id': 26854659, 'user_AboutMe': None, 'user_AccountId': 3194608.0, 'user_DisplayName': 'user2698080', 'user_Reputation': 13.0, 'user_Views': 14.0, 'user_id': 2698080.0}}