Similar Pages

My Java IDE Home Page
My Little Java MP3 Player Home Page
There are tons of .mp3 players out in the world, freeware, shareware and commercial, and they all get the job done.  So why, you may ask, write another one?  A couple of reasons, really.  First, because there aren't many written in Java and I wanted to demonstrate what Java is capable of.  Second, it was a good learning experience for me.  Finally, because I wanted something to use that was a little less obtrusive than WinAmp or MusicMatch.  Don't get me wrong those are both great products, but I wanted something that took up less screen real estate and memory.

The Java Media Foundation no longer includes support for decoding mp3 files, so I've been on the prowl for another cross-platform open source decoder.  The most common and widely used is the JavaLayer project at JavaZoom.  I resisted using this product for a long time because of it's complexity, but eventually I relented.  So now JavaPlayer is using a greatly reduced and modified version of JavaLayer.

I use some of the new features of Java 1.6 in this project, so you will need at least 1.6 to compile and run JavaPlayer.

One additional note.  Previous versions of JavaPlayer stored session information and the current playlist using the Preferences classes and text files.  We are now using the Hypersonic 2 embedded database to store everything, and the database is written to the $home/.javaplayer directory.  So in order to use JavaPlayer you will need the h2.jar file included in your classpath.  You can find it here:


Click the download link above and choose to save the file into some directory or other.  (c:\JavaPlayer for example)

Once the file is downloaded you will need to unzip it using WinZip or some other compatible program.

The zip file contains all of the java files needed to run JavaPlayer under Windows and Linux.  You won't need anything else to run JavaPlayer.

The examples I'm using are for Windows, but it should be similar for any other platform.

Unpack JavaPlayer.zip to your hard drive (ie C:\JavaPlayer).  Change into the src directory.  The command line to build the program (using jdk 1.6) would be as follows:

"C:\Program Files\Java\jdk1.6.0\bin\javac" -classpath . javaplayer\Main.java

To execute JavaPlayer use this:

"C:\Program Files\Java\jdk1.6.0\bin\java" -classpath . javaplayer.Main

Once the compile is complete you can archive the classes and included gif files using the jar executable and execute the program with this command:

"C:\Program Files\Java\jdk1.6.0\bin\java" -jar JavaPlayer.jar


 

page created with Webpage Designer (NS)