There's no need to build it from source. You can run jDownloader from JAR file on headless server. Create an account on my.jdownloader page link your server to the account using your credentials. Then you can manage your links and download queue ia web or Android app.