Hi, I'm building an application and I want to it to play mp3 files.
I have it working, basically by installing JMF2.1.1e, and then I add its jmf.jar file to the build path of the project within eclipse.

When I then jar up the project, and place on desktop, it works fine.

But the project relies on the JMF2.1.1e being installed, I'd like to make it portable so the project can be run on any computer that has a jdk1.4(or higher) installed, without having to install the JMF.

So basically I would like to try and add the components of the JMF2.1.1e to my project, and bundle them into the projects jar file, when I turn it into a jar.

I can't quite get it to work though, if anyone can help, I'd be very greatful.
My messenger address is cms271828 (yahoo) and [EMAIL="colin.shuker@tiscali.co.uk(msn"]colin.shuker@tiscali.co.uk(msn[/EMAIL]),
if anyone would like to chat with me direct, which would probably be easier for me.

Thanks for any help

You won't be able to put jars in your jar. Typically you would just include that jar file in a" /lib" folder in your installation and add that reference to the class path entry in your application jar manifest file.

Yeh, currently I'm adding the jmf.jar to the build path, but its not really adding it, its just adding the path of the jar file.

I'm trying to make the project portable, so users can just download a jar file of project, and possibly install JMF2.1.1e, and then the jar file of project will work, and play sounds.

I guess... If users install JMF2.1.1e in a specific location, eg C:/Program Files/JMF2.1.1e,
Then inside eclipse, I can configure the build path to use C:/Program Files/JMF2.1.1e/lib/jmf.jar.

So when I jar up the project, and a user downloads it, it will know where to look for jmf.jar.

Isn't there another way, like by adding the contents of jmf.jar inside the project somehow?


You really don't want to realy on the users installing JMF to a particular place. It's much easier to manage if you just zip or tar your project into a structure that includes JMF in a /lib folder and use that with your class path. The zip or tar file is still portable, they just have to uncompress it wherever they like. Keeping third party libraries in the /lib folder makes it easier to manage for you and the users.

Actually you CAN add Jars on your path to the Jar when you Jar up a Project. I do it all the time using FatJar (Eclipse Plugin) and it makes it way easy.

I'm also trying to get a JMF app that can run anywhere without any setup on the end machine. In this case it's for code I'm going to run on company servers, not a user's machine.

This article has been dead for over six months. Start a new discussion instead.