I recently started to program my first java project on my new raspberry pi. Its going to be an automated alarm clock which plays my favourite music every morning. To implement this I wanted to use "music player daemon" and the java api "java mpd". Im currently programming with Geany and happy its going well by now :) The only problem I encountered is that I don't know how to link external libraries to my project. The file I want to link is a simple *.jar file. I need to get the java mpd library in my project to start working with it. Thanks for your help :)

有帮助吗?

解决方案

You need to add it to the classpath using the -classpath option i.e.

java -classpath myjar.jar:. MyProgram

You have to include . so that java can find your class file.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top