Вопрос

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