Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #27558 > unrolled thread

error discription and solution

Started byNavneet Mathpal <navneetmathpal93@gmail.com>
First post2014-02-20 00:59 -0800
Last post2014-02-21 19:48 -0500
Articles 20 on this page of 36 — 12 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  error discription and solution Navneet Mathpal <navneetmathpal93@gmail.com> - 2014-02-20 00:59 -0800
    Re: error discription and solution Lew <lewbloch@gmail.com> - 2014-02-20 14:05 -0800
    Re: error discription and solution Roedy Green <see_website@mindprod.com.invalid> - 2014-02-21 08:56 -0800
      Re: error discription and solution lipska the kat <lipskathekat@example.com> - 2014-02-21 17:53 +0000
        Re: error discription and solution Roedy Green <see_website@mindprod.com.invalid> - 2014-02-26 10:22 -0800
          Re: error discription and solution lipska the kat <lipskathekat@example.com> - 2014-02-26 19:30 +0000
            Re: error discription and solution Joerg Meier <joergmmeier@arcor.de> - 2014-02-26 21:26 +0100
              Re: error discription and solution lipska the kat <lipskathekat@example.com> - 2014-02-26 21:19 +0000
                Re: error discription and solution Joerg Meier <joergmmeier@arcor.de> - 2014-02-26 23:04 +0100
                Re: error discription and solution leif.roar@invalid.com (Leif Roar Moldskred) - 2014-02-26 16:53 -0600
                  Re: error discription and solution lipska the kat <lipskathekat@example.com> - 2014-02-27 08:34 +0000
              Re: error discription and solution lipska the kat <lipskathekat@example.com> - 2014-03-03 09:27 +0000
                Re: error discription and solution Joerg Meier <joergmmeier@arcor.de> - 2014-03-03 11:56 +0100
                  Re: error discription and solution lipska the kat <lipskathekat@example.com> - 2014-03-03 12:08 +0000
                    Re: error discription and solution leif.roar@invalid.com (Leif Roar Moldskred) - 2014-03-03 06:26 -0600
                      Re: error discription and solution lipska the kat <lipskathekat@example.com> - 2014-03-03 12:44 +0000
                        Re: error discription and solution leif.roar@invalid.com (Leif Roar Moldskred) - 2014-03-03 06:58 -0600
                    Re: error discription and solution Joerg Meier <joergmmeier@arcor.de> - 2014-03-03 17:11 +0100
                      Re: error discription and solution leif.roar@invalid.com (Leif Roar Moldskred) - 2014-03-03 10:17 -0600
                        Re: error discription and solution Joerg Meier <joergmmeier@arcor.de> - 2014-03-03 17:39 +0100
                          Re: error discription and solution Simon Lewis <simonlewis2001@gmail.com> - 2014-03-03 20:47 +0100
                          Re: error discription and solution Eric Sosman <esosman@comcast-dot-net.invalid> - 2014-03-03 17:04 -0500
                            Re: error discription and solution "Chris Uppal" <chris.uppal@metagnostic.REMOVE-THIS.org> - 2014-03-06 15:25 +0000
                              Future of computing [Was: Re: error discription and solution] Eric Sosman <esosman@comcast-dot-net.invalid> - 2014-03-06 12:03 -0500
                        Re: error discription and solution lipska the kat <lipskathekat@example.com> - 2014-03-03 17:21 +0000
                      Re: error discription and solution lipska the kat <lipskathekat@example.com> - 2014-03-03 17:18 +0000
                        Re: error discription and solution leif.roar@invalid.com (Leif Roar Moldskred) - 2014-03-03 11:26 -0600
                          Re: error discription and solution lipska the kat <lipskathekat@example.com> - 2014-03-03 18:31 +0000
                        Re: error discription and solution Joerg Meier <joergmmeier@arcor.de> - 2014-03-03 21:00 +0100
                          Re: error discription and solution lipska the kat <lipskathekat@example.com> - 2014-03-03 20:19 +0000
                      Re: error discription and solution Simon Lewis <simonlewis2001@gmail.com> - 2014-03-03 20:46 +0100
          Re: error discription and solution Jukka Lahtinen <jtfjdehf@hotmail.com.invalid> - 2014-02-26 23:39 +0200
            Re: error discription and solution Roedy Green <see_website@mindprod.com.invalid> - 2014-02-28 09:08 -0800
              Re: error discription and solution Joerg Meier <joergmmeier@arcor.de> - 2014-02-28 20:05 +0100
                Re: error discription and solution Gene Wirchenko <genew@telus.net> - 2014-02-28 15:29 -0800
    Re: error discription and solution Arne Vajhøj <arne@vajhoej.dk> - 2014-02-21 19:48 -0500

Page 1 of 2  [1] 2  Next page →


#27558 — error discription and solution

FromNavneet Mathpal <navneetmathpal93@gmail.com>
Date2014-02-20 00:59 -0800
Subjecterror discription and solution
Message-ID<7ad4a15c-7e35-4d08-a61f-4d673f5d4ef0@googlegroups.com>
HTTP Status 500 - Handler processing failed; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/lang/ArrayUtils

[toc] | [next] | [standalone]


#27560

FromLew <lewbloch@gmail.com>
Date2014-02-20 14:05 -0800
Message-ID<f69a18ff-7ea4-4d6d-8ca7-1793d4402af3@googlegroups.com>
In reply to#27558
Navneet Mathpal wrote:
> HTTP Status 500 - Handler processing failed; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/lang/ArrayUtils

http://sscce.org/

-- 
Lew

[toc] | [prev] | [next] | [standalone]


#27566

FromRoedy Green <see_website@mindprod.com.invalid>
Date2014-02-21 08:56 -0800
Message-ID<081fg9thirl4u17mdbeq8q3oocgtbakr7t@4ax.com>
In reply to#27558
On Thu, 20 Feb 2014 00:59:55 -0800 (PST), Navneet Mathpal
<navneetmathpal93@gmail.com> wrote, quoted or indirectly quoted
someone who said :

>NoClassDefFoundError

My condolences. This is my least favourite error message.
see
http://mindprod.com/jgloss/runerrormessages.html#NOCLASSDEFFOUNDERROR
-- 
Roedy Green Canadian Mind Products http://mindprod.com
The future has already happened, it just isn’t evenly distributed.
~ William Gibson (born: 1948-03-17 age: 65)

[toc] | [prev] | [next] | [standalone]


#27567

Fromlipska the kat <lipskathekat@example.com>
Date2014-02-21 17:53 +0000
Message-ID<xY-dnR_CKP87D5rOnZ2dnUVZ8sOdnZ2d@bt.com>
In reply to#27566
On 21/02/14 16:56, Roedy Green wrote:
> On Thu, 20 Feb 2014 00:59:55 -0800 (PST), Navneet Mathpal
> <navneetmathpal93@gmail.com> wrote, quoted or indirectly quoted
> someone who said :
>
>> NoClassDefFoundError
>
> My condolences.

Very funny, <huge grin>

-- 
Lipska the Kat©: Troll hunter, sandbox destroyer,
treacherous feline and farscape dreamer of Aeryn Sun
GNU/Linux user #560883 - http://www.linuxcounter.net

[toc] | [prev] | [next] | [standalone]


#27599

FromRoedy Green <see_website@mindprod.com.invalid>
Date2014-02-26 10:22 -0800
Message-ID<d2csg99t6f80cfueq2nr0430u2bnu168om@4ax.com>
In reply to#27567
On Fri, 21 Feb 2014 17:53:40 +0000, lipska the kat
<lipskathekat@example.com> wrote, quoted or indirectly quoted someone
who said :

>>> NoClassDefFoundError
>>
>> My condolences.
>
>Very funny, <huge grin>

The problem is there are so many different things you can do wrong
that generate the error.

I would hope Oracle could find some way to subclass
NoClassDefFoundError the way IOException is, to give you a better hint
on just what you screwed up, or perhaps to include more hints in the
message.

Tracking down NoClassDefFoundError is one of the most onerous errors.

-- 
Roedy Green Canadian Mind Products http://mindprod.com
The future has already happened, it just isn’t evenly distributed.
~ William Gibson (born: 1948-03-17 age: 65)

[toc] | [prev] | [next] | [standalone]


#27600

Fromlipska the kat <lipskathekat@example.com>
Date2014-02-26 19:30 +0000
Message-ID<bpGdncHeXqRa3ZPOnZ2dnUVZ8q-dnZ2d@bt.com>
In reply to#27599
On 26/02/14 18:22, Roedy Green wrote:
> On Fri, 21 Feb 2014 17:53:40 +0000, lipska the kat
> <lipskathekat@example.com> wrote, quoted or indirectly quoted someone
> who said :
>
>>>> NoClassDefFoundError
>>>
>>> My condolences.
>>
>> Very funny, <huge grin>
>
> The problem is there are so many different things you can do wrong
> that generate the error.
>
> I would hope Oracle could find some way to subclass
> NoClassDefFoundError the way IOException is, to give you a better hint
> on just what you screwed up, or perhaps to include more hints in the
> message.
>
> Tracking down NoClassDefFoundError is one of the most onerous errors.

Agreed, classpath confusions notwithstanding, (which IME can cause a lot 
of problems to noobs) Apache commons stuff is not so bad, you can get to 
the commons site and track down the relevant jar easily enough but 
trying to figure out which jar contains 
com.foobar.hidden.widget.PoopScoop and where to get it is a different 
matter altogether.


-- 
Lipska the Kat©: Troll hunter, sandbox destroyer,
treacherous feline and farscape dreamer of Aeryn Sun
GNU/Linux user #560883 - http://www.linuxcounter.net

[toc] | [prev] | [next] | [standalone]


#27601

FromJoerg Meier <joergmmeier@arcor.de>
Date2014-02-26 21:26 +0100
Message-ID<va2juw1qwd15$.1k5tuuxq9sccs$.dlg@40tude.net>
In reply to#27600
On Wed, 26 Feb 2014 19:30:12 +0000, lipska the kat wrote:

> Agreed, classpath confusions notwithstanding, (which IME can cause a lot 
> of problems to noobs) Apache commons stuff is not so bad, you can get to 
> the commons site and track down the relevant jar easily enough but 
> trying to figure out which jar contains 
> com.foobar.hidden.widget.PoopScoop and where to get it is a different 
> matter altogether.

Jarfinder is helpful in these scenarios, although unless you are stuck in
the dark ages I recommend searching the Maven repository for the classname
before anything else.

Liebe Gruesse,
		Joerg

-- 
Ich lese meine Emails nicht, replies to Email bleiben also leider
ungelesen.

[toc] | [prev] | [next] | [standalone]


#27604

Fromlipska the kat <lipskathekat@example.com>
Date2014-02-26 21:19 +0000
Message-ID<dfCdnVJNLs7Kx5POnZ2dnUVZ8iednZ2d@bt.com>
In reply to#27601
On 26/02/14 20:26, Joerg Meier wrote:
> On Wed, 26 Feb 2014 19:30:12 +0000, lipska the kat wrote:
>
>> Agreed, classpath confusions notwithstanding, (which IME can cause a lot
>> of problems to noobs) Apache commons stuff is not so bad, you can get to
>> the commons site and track down the relevant jar easily enough but
>> trying to figure out which jar contains
>> com.foobar.hidden.widget.PoopScoop and where to get it is a different
>> matter altogether.
>
> Jarfinder is helpful in these scenarios, although unless you are stuck in
> the dark ages I recommend searching the Maven repository for the classname
> before anything else.

I looked at Maven once. As soon as it started 'updating' itself I shut 
it down, un-installed it and never went near that abomination again :-)

I just don't trust anything that connects to a remote server without my 
explicit say so.

-- 
Lipska the Kat©: Troll hunter, sandbox destroyer,
treacherous feline and farscape dreamer of Aeryn Sun
GNU/Linux user #560883 - http://www.linuxcounter.net

[toc] | [prev] | [next] | [standalone]


#27606

FromJoerg Meier <joergmmeier@arcor.de>
Date2014-02-26 23:04 +0100
Message-ID<452pihstl7h7$.xrzg96ikn8xm.dlg@40tude.net>
In reply to#27604
On Wed, 26 Feb 2014 21:19:07 +0000, lipska the kat wrote:

> On 26/02/14 20:26, Joerg Meier wrote:
>> On Wed, 26 Feb 2014 19:30:12 +0000, lipska the kat wrote:
>>> Agreed, classpath confusions notwithstanding, (which IME can cause a lot
>>> of problems to noobs) Apache commons stuff is not so bad, you can get to
>>> the commons site and track down the relevant jar easily enough but
>>> trying to figure out which jar contains
>>> com.foobar.hidden.widget.PoopScoop and where to get it is a different
>>> matter altogether.
>> Jarfinder is helpful in these scenarios, although unless you are stuck in
>> the dark ages I recommend searching the Maven repository for the classname
>> before anything else.
> I looked at Maven once. As soon as it started 'updating' itself I shut 
> it down, un-installed it and never went near that abomination again :-)

> I just don't trust anything that connects to a remote server without my 
> explicit say so.

Well, that is explicitly what Maven is for, so I must say, as much as there
are valid reasons to be unhappy with Maven, in this case the fault lies
with you. It's like uninstalling an Email program because it connected to
the Internet. One of, if not THE top feature of Maven is that it
automatically resolves dependencies and updates jars from the Internet.

Liebe Gruesse,
		Joerg

-- 
Ich lese meine Emails nicht, replies to Email bleiben also leider
ungelesen.

[toc] | [prev] | [next] | [standalone]


#27608

Fromleif.roar@invalid.com (Leif Roar Moldskred)
Date2014-02-26 16:53 -0600
Message-ID<KpCdnfA7Uf_67ZPOnZ2dnUVZ8kydnZ2d@giganews.com>
In reply to#27604
lipska the kat <lipskathekat@example.com> wrote:
> 
> I looked at Maven once. As soon as it started 'updating' itself I shut 
> it down, un-installed it and never went near that abomination again :-)
> 
> I just don't trust anything that connects to a remote server without my 
> explicit say so.
> 

I would suggest that you read up enough on Maven to understand what it
is it does, and why it makes sense that it connects to a remote server
unless you explicitly tells it not to.

Maven is not perfect, but there are valid reasons why it has become
the default build system for most java projects. While it's not my
preferred build system (in fact, I quite dislike it), it is in so
widespread use that I would say that basic Maven competence is a
requirement for pretty much anyone doing professional java development
today.

-- 
Leif Roar Moldskred

[toc] | [prev] | [next] | [standalone]


#27610

Fromlipska the kat <lipskathekat@example.com>
Date2014-02-27 08:34 +0000
Message-ID<Na-dnTJAn_ACZZPOnZ2dnUVZ8hOdnZ2d@bt.com>
In reply to#27608
On 26/02/14 22:53, Leif Roar Moldskred wrote:
> lipska the kat <lipskathekat@example.com> wrote:
>>
>> I looked at Maven once. As soon as it started 'updating' itself I shut
>> it down, un-installed it and never went near that abomination again :-)
>>
>> I just don't trust anything that connects to a remote server without my
>> explicit say so.
>>
>
> I would suggest that you read up enough on Maven to understand what it
> is it does, and why it makes sense that it connects to a remote server
> unless you explicitly tells it not to.
>
> Maven is not perfect, but there are valid reasons why it has become
> the default build system for most java projects. While it's not my
> preferred build system (in fact, I quite dislike it), it is in so
> widespread use that I would say that basic Maven competence is a
> requirement for pretty much anyone doing professional java development
> today.

I've built and maintained (and maintain) million plus line applications 
without going anywhere near that hideous mess thank you very much.

Also, I have *never* been asked any questions concerning Maven at 
interviews nor have I ever worked on a project that uses Maven so 
obviously our mileages vary.


-- 
Lipska the Kat©: Troll hunter, sandbox destroyer,
treacherous feline and farscape dreamer of Aeryn Sun
GNU/Linux user #560883 - http://www.linuxcounter.net

[toc] | [prev] | [next] | [standalone]


#27657

Fromlipska the kat <lipskathekat@example.com>
Date2014-03-03 09:27 +0000
Message-ID<97SdnYwVB7SC1onOnZ2dnUVZ8gednZ2d@bt.com>
In reply to#27601
On 26/02/14 20:26, Joerg Meier wrote:
> On Wed, 26 Feb 2014 19:30:12 +0000, lipska the kat wrote:
>
>> Agreed, classpath confusions notwithstanding, (which IME can cause a lot
>> of problems to noobs) Apache commons stuff is not so bad, you can get to
>> the commons site and track down the relevant jar easily enough but
>> trying to figure out which jar contains
>> com.foobar.hidden.widget.PoopScoop and where to get it is a different
>> matter altogether.
>
> Jarfinder is helpful in these scenarios,

I'm trying to get the Java DBus bindings to compile but I can't find the 
required jars to compile the libraries and presumably the jars but there 
are no jars etc etc etc

git clone git://anongit.freedesktop.org/git/dbus/dbus-java

$ make

warning: [path] bad path element "/usr/share/java/unix.jar": no such 
file or directory
warning: [path] bad path element "/usr/share/java/debug-disable.jar": no 
such file or directory
warning: [path] bad path element "/usr/share/java/hexdump.jar": no such 
file or directory

...

I just tried Jarfinder.com and it doesn't appear to do anything apart 
from redirect to a 'not found' page.

> although unless you are stuck in
> the dark ages I recommend searching the Maven repository for the classname
> before anything else.

Yes, although it's difficult to know a classname without the jar ... 
isn't it? I tried searching for some classes mentioned in the error 
output but to no avail.

I'm starting to think Roedy is correct, there needs to be a standard way 
to find this stuff.


-- 
Lipska the Kat©: Troll hunter, sandbox destroyer,
treacherous feline and farscape dreamer of Aeryn Sun
GNU/Linux user #560883 - http://www.linuxcounter.net

[toc] | [prev] | [next] | [standalone]


#27660

FromJoerg Meier <joergmmeier@arcor.de>
Date2014-03-03 11:56 +0100
Message-ID<dwfcxug8g4jg.1qivskyms464q.dlg@40tude.net>
In reply to#27657
On Mon, 03 Mar 2014 09:27:53 +0000, lipska the kat wrote:

> On 26/02/14 20:26, Joerg Meier wrote:
>> On Wed, 26 Feb 2014 19:30:12 +0000, lipska the kat wrote:
>>> Agreed, classpath confusions notwithstanding, (which IME can cause a lot
>>> of problems to noobs) Apache commons stuff is not so bad, you can get to
>>> the commons site and track down the relevant jar easily enough but
>>> trying to figure out which jar contains
>>> com.foobar.hidden.widget.PoopScoop and where to get it is a different
>>> matter altogether.
>> Jarfinder is helpful in these scenarios,
> I'm trying to get the Java DBus bindings to compile but I can't find the 
> required jars to compile the libraries and presumably the jars but there 
> are no jars etc etc etc

> git clone git://anongit.freedesktop.org/git/dbus/dbus-java

> $ make

> warning: [path] bad path element "/usr/share/java/unix.jar": no such 
> file or directory

If it used Maven, then it would at this point have downloaded everything
you needed. Of course, it would have downloaded it from the internet, which
you seem to find objectionable for some reason, yet here you are, looking
for a way to download these files in painstaking manual steps from the very
same internet.

> I just tried Jarfinder.com and it doesn't appear to do anything apart 
> from redirect to a 'not found' page.

Apologies, it is findjar.com, not jarfinder.com. I haven't used it ever
since I left Ant behind so my memory was a bit hazy.

>> although unless you are stuck in
>> the dark ages I recommend searching the Maven repository for the classname
>> before anything else.
> Yes, although it's difficult to know a classname without the jar ... 
> isn't it? I tried searching for some classes mentioned in the error 
> output but to no avail.

I'm honestly surprised that you are stumped by what even a cursory
knowledge of Java should have made trivial - simply remove the missing jars
from the class path, compile, and you will get the names and package names
of classes that are missing.

> I'm starting to think Roedy is correct, there needs to be a standard way 
> to find this stuff.

I agree. Luckily, the rest of the development world agreed that dependency
management was a pain, and came up with a solution:
<http://maven.apache.org/>

Sorry for the cheek, but you do seem to be primarily complaining that
nobody has invented Maven yet ;-)

Liebe Gruesse,
		Joerg

-- 
Ich lese meine Emails nicht, replies to Email bleiben also leider
ungelesen.

[toc] | [prev] | [next] | [standalone]


#27661

Fromlipska the kat <lipskathekat@example.com>
Date2014-03-03 12:08 +0000
Message-ID<ROOdnXsgfJUv7YnOnZ2dnUVZ8qCdnZ2d@bt.com>
In reply to#27660
On 03/03/14 10:56, Joerg Meier wrote:
> On Mon, 03 Mar 2014 09:27:53 +0000, lipska the kat wrote:
>
>> On 26/02/14 20:26, Joerg Meier wrote:
>>> On Wed, 26 Feb 2014 19:30:12 +0000, lipska the kat wrote:
>>>> Agreed, classpath confusions notwithstanding, (which IME can cause a lot
>>>> of problems to noobs) Apache commons stuff is not so bad, you can get to
>>>> the commons site and track down the relevant jar easily enough but
>>>> trying to figure out which jar contains
>>>> com.foobar.hidden.widget.PoopScoop and where to get it is a different
>>>> matter altogether.
>>> Jarfinder is helpful in these scenarios,
>> I'm trying to get the Java DBus bindings to compile but I can't find the
>> required jars to compile the libraries and presumably the jars but there
>> are no jars etc etc etc
>
>> git clone git://anongit.freedesktop.org/git/dbus/dbus-java
>
>> $ make
>
>> warning: [path] bad path element "/usr/share/java/unix.jar": no such
>> file or directory
>
> If it used Maven, then it would at this point have downloaded everything
> you needed. Of course, it would have downloaded it from the internet, which
> you seem to find objectionable for some reason,

Well now we don't want another flame war here do we so I'll just ignore 
all the aspersion casting and assumptions about my abilities.

I did search something calling itself a Maven repository to no avail, 
actually it turns out that the relevant jars need compiling on the 
system on which they are going to be used as there seems to be all sorts 
of platform specific C code and jni stuff that needs compiling with the 
gcc toolchain ... apparently.

So, once I figured this out and downloaded the code for the missing jars 
(which I found via a good old fashioned Google search) I compiled same 
and ended up the missing jars and a couple of platform specific shared 
libraries.

So, now I could install the libs and the jars and compile the bindings, 
once I had fixed the makefile to point at the correct directory that is.

And here we are, the libs are installed, the bindings are compiled and I 
have three nice new jar files (a different three jar files) that I can 
tell Eclipse about and away we go ... hopefully, although I'm not 
holding my breath :-)

Maven wouldn't have helped in this case would it? I couldn't know the 
names of the binding jars as I couldn't compile them because the jars 
required to compile the bindings were missing until I compiled them, it 
was the jars required to compile the bindings that I was missing, not 
the binding jars themselves.

What would Maven have made of this I wonder ... how much would I have 
learned by 'leaving it all to Maven'. At least I now know what the 
problem was and how to fix it.

If you don't understand this then I suggest that sooner or later you are 
going to come up against a problem that the tools can't fix and then 
you'll be stuck, won't you?

I'd rather use the bare minimum of tools to get the job done.
How much time have I saved, or rather not wasted by not spending it 
learning the latest greatest tool only for it to be superseded a few 
weeks/months/years later by the next latest greatest tool. I can write 
compile and run Java with a simple text editor, a terminal window and a 
shell script if I have to. I certainly don't need Maven to hold my hand.

<snip>

-- 
Lipska the Kat©: Troll hunter, sandbox destroyer,
treacherous feline and farscape dreamer of Aeryn Sun
GNU/Linux user #560883 - http://www.linuxcounter.net

[toc] | [prev] | [next] | [standalone]


#27662

Fromleif.roar@invalid.com (Leif Roar Moldskred)
Date2014-03-03 06:26 -0600
Message-ID<xbKdnUA8stpD6YnOnZ2dnUVZ7tednZ2d@giganews.com>
In reply to#27661
lipska the kat <lipskathekat@example.com> 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.

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.

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, 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.

-- 
Leif Roar Moldskred

[toc] | [prev] | [next] | [standalone]


#27663

Fromlipska the kat <lipskathekat@example.com>
Date2014-03-03 12:44 +0000
Message-ID<wc-dnbJBEMmB5InOnZ2dnUVZ7sednZ2d@bt.com>
In reply to#27662
On 03/03/14 12:26, Leif Roar Moldskred wrote:
> lipska the kat <lipskathekat@example.com> 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

[toc] | [prev] | [next] | [standalone]


#27664

Fromleif.roar@invalid.com (Leif Roar Moldskred)
Date2014-03-03 06:58 -0600
Message-ID<ovydnalGiqzy4YnOnZ2dnUVZ8lKdnZ2d@giganews.com>
In reply to#27663
lipska the kat <lipskathekat@example.com> wrote:
> 
> No idea what a Sonar report is, should I care?
> 

It's a tool for generating build reports with various metrics for code
quality, test coverage, style guide adherence and so on. It can be
useful in a well organized development process, but it's not a game
changer.

-- 
Leif Roar Moldskred

[toc] | [prev] | [next] | [standalone]


#27665

FromJoerg Meier <joergmmeier@arcor.de>
Date2014-03-03 17:11 +0100
Message-ID<140f3bv3kst7.7zenor3r2v2k.dlg@40tude.net>
In reply to#27661
On Mon, 03 Mar 2014 12:08:16 +0000, lipska the kat wrote:

> I did search something calling itself a Maven repository to no avail, 
> actually it turns out that the relevant jars need compiling on the 
> system on which they are going to be used as there seems to be all sorts 
> of platform specific C code and jni stuff that needs compiling with the 
> gcc toolchain ... apparently.

As Leif already said, this is obviously not a good solution, but even in
this case, where Maven indeed wouldn't have been able to FIX the problem
for you, you still would have benefited from a pom.xml, because it has a
proper and well specified way of describing dependencies - you would, at a
single glance have known: the name of the jar, the name of the package
(which should be easily googleable), and the fact that it was something you
had to install yourself manually.

> Maven wouldn't have helped in this case would it? I couldn't know the 
> names of the binding jars as I couldn't compile them because the jars 
> required to compile the bindings were missing until I compiled them, it 
> was the jars required to compile the bindings that I was missing, not 
> the binding jars themselves.

Like I said, Maven would at the very least have given you all the
neccessary information needed to find the missing jars to compile.

> What would Maven have made of this I wonder ... how much would I have 
> learned by 'leaving it all to Maven'. At least I now know what the 
> problem was and how to fix it.

There is a distinct difference between learning and doing. It is of course
entirely reasonable to want to learn how to compile things in Java, and
naturally, no sane person would recommend to learn that by using Maven.

> If you don't understand this then I suggest that sooner or later you are 
> going to come up against a problem that the tools can't fix and then 
> you'll be stuck, won't you?

No, of course not. I wasn't born with Maven knowledge implanted into my
brain, then unable to learn anything else. In fact, as you can tell from my
earlier explanation, I was easily able to tell you how to solve a problem
you had without using Maven, thanks to my understanding of the Java build
process.

> I'd rather use the bare minimum of tools to get the job done.
> How much time have I saved, or rather not wasted by not spending it 
> learning the latest greatest tool only for it to be superseded a few 
> weeks/months/years later by the next latest greatest tool. I can write 
> compile and run Java with a simple text editor, a terminal window and a 
> shell script if I have to. I certainly don't need Maven to hold my hand.

That is an unfair and disgenuine argument. Nobody is suggesting people
don't LEARN how things work. You asked how to get something to work, not
how to learn about how the Java build process works. Going by your answer,
I would suggest you abandon Java completely, and instead focus on learning
Assembler, which of course you should only ever write using Notepad.

After all, you would only want to use the bare minimum of tools, and not
have fancy things like garbage collection and abstraction, right ? How much
time you would save, by not learning the latest greatest language, only for
it to be superseded a few years later ?

Understanding how things work at their core is a useful skill that should
certainly be part of any decent education, whether in class or as an
autodidact. On the other hand, suggesting to stick to the lower and most
primitive solution while actually working is ridiculous and held only by
the most ancient and inflexible dinosaurs.

Hopefully, you didn't really mean to suggest that it's actually better to
use Notepad instead of Eclipse, a command line to compile and a hand
written batch file to package instead of Ant/Maven and whatever other way
to do things manually you can think of while doing actual work. As much as
these things should be part of learning, they shouldn't be part of
producing.

Liebe Gruesse,
		Joerg

-- 
Ich lese meine Emails nicht, replies to Email bleiben also leider
ungelesen.

[toc] | [prev] | [next] | [standalone]


#27667

Fromleif.roar@invalid.com (Leif Roar Moldskred)
Date2014-03-03 10:17 -0600
Message-ID<qLOdnRNL_dCeNonOnZ2dnUVZ7vidnZ2d@giganews.com>
In reply to#27665
Joerg Meier <joergmmeier@arcor.de> wrote:
 
> That is an unfair and disgenuine argument. Nobody is suggesting people
> don't LEARN how things work. You asked how to get something to work, not
> how to learn about how the Java build process works. Going by your answer,
> I would suggest you abandon Java completely, and instead focus on learning
> Assembler, which of course you should only ever write using Notepad.
> 

Obligatory link to the Story of Mel:

http://www.catb.org/jargon/html/story-of-mel.html


-- 
Leif Roar Moldskred

[toc] | [prev] | [next] | [standalone]


#27668

FromJoerg Meier <joergmmeier@arcor.de>
Date2014-03-03 17:39 +0100
Message-ID<5ujw21gfmtzd$.1jtrdvdlsnf4y.dlg@40tude.net>
In reply to#27667
On Mon, 03 Mar 2014 10:17:07 -0600, Leif Roar Moldskred wrote:

> Joerg Meier <joergmmeier@arcor.de> wrote:
>> That is an unfair and disgenuine argument. Nobody is suggesting people
>> don't LEARN how things work. You asked how to get something to work, not
>> how to learn about how the Java build process works. Going by your answer,
>> I would suggest you abandon Java completely, and instead focus on learning
>> Assembler, which of course you should only ever write using Notepad.
> Obligatory link to the Story of Mel:

> http://www.catb.org/jargon/html/story-of-mel.html

Every few years, someone links this, and every time, I read it again to my
great delight. As my life progresses, it's interesting for me to note how
my view of Mel changed over the years - from uncompromising and unreflected
hero worship when I was still young and a cowboy, to "I hope I never have
to fix code like that" when I started working on multi-person projects for
the first time, to "I hope I never have a coworker like that", ending with
"I hope I never have an employee like that".

Mel is, at once, the best and the worst aspects of a clever programmer.

Liebe Gruesse,
		Joerg

-- 
Ich lese meine Emails nicht, replies to Email bleiben also leider
ungelesen.

[toc] | [prev] | [next] | [standalone]


Page 1 of 2  [1] 2  Next page →

Back to top | Article view | comp.lang.java.programmer


csiph-web