Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder5.xlned.com!news.astraweb.com!border5.a.newsrouter.astraweb.com!border2.nntp.ams.giganews.com!Xl.tags.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!local2.nntp.ams.giganews.com!nntp.bt.com!news.bt.com.POSTED!not-for-mail NNTP-Posting-Date: Mon, 03 Mar 2014 06:44:12 -0600 Date: Mon, 03 Mar 2014 12:44:10 +0000 From: lipska the kat Organization: Trollbusters 3 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130308 Thunderbird/17.0.4 MIME-Version: 1.0 Newsgroups: comp.lang.java.programmer Subject: Re: error discription and solution References: <7ad4a15c-7e35-4d08-a61f-4d673f5d4ef0@googlegroups.com> <081fg9thirl4u17mdbeq8q3oocgtbakr7t@4ax.com> <97SdnYwVB7SC1onOnZ2dnUVZ8gednZ2d@bt.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Message-ID: Lines: 61 X-Usenet-Provider: http://www.giganews.com X-AuthenticatedUsername: NoAuthUser X-Trace: sv3-PNEmc9FZ7rGJLKrXfMGngf5OabPl3/a6qhvL9thgwQlL2o6Xk+5bcmKaMAbjmEEKJExf8xyBP6Tggtw!gH7Zfb+ahj1Q+VU4n/HWD/TxkuA5TptI3TN0+Y/DFHzjJGFgCO4W861Y1+HNTKRWX6j4gqZ8AnU= X-Complaints-To: abuse@btinternet.com X-DMCA-Complaints-To: abuse@btinternet.com X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 4081 Xref: csiph.com comp.lang.java.programmer:27663 On 03/03/14 12:26, Leif Roar Moldskred wrote: > lipska the kat wrote: > >> Maven wouldn't have helped in this case would it? > > No; those dependencies are basically system libraries and need to be > installed on your system and properly linked to other system libraries. > Maven won't handle help you resolve that. You are correct, they are system libs The libs need to be compiled, linked and installed before the jars depending on them can be compiled, then, when everything is in place the binding jars can be compiled, these depend on the jars that depend on the libs. At runtime the system libraries need to be made visible via -Djava.library.path. DBusConnection.getConnection(DBusConnection.SESSION); will compile but not run until -Djava.library.path is set to the location of the system libraries. Once I figured this out the code compiles and runs. Actually I really want to use the C glib bindings but the documentation is ... difficult so I thought I'd try and get it working in Java first. Apparently however I'm not smart enough to do that, guess it was just luck then :-) > One could argue that it might have been better if the jars in question > were divided into a system jar, with the actual JNI code and linkage, > and an API jar with just the API interfaces and a factory for the > implementation. Applications that makes use of these libraries could > then make do with dependencies only to the API jars and not have any > dependencies on the system level. Yes, actually I was surprised that I needed to tell Eclipse where to find the system libraries before the code would run, I was hoping that dependency was compile time only for the bindings, effectively they would encapsulate the platform specific stuff. I expect it's because I'm not very smart. > You'd still need to install the jars manually (or use your OS's > package manager system) before you could _run_ the dependent > application, of course, make > but it would make it a lot easier to build the > application in a normal Java build pipeline, allowing you to do easily > do Continuous Integration, generate Sonar reports and so on. No idea what a Sonar report is, should I care? -- Lipska the Kat©: Troll hunter, sandbox destroyer, treacherous feline and farscape dreamer of Aeryn Sun GNU/Linux user #560883 - http://www.linuxcounter.net