Hello everyone,
Hopefully someone will have had this problem before (i can't beleive i
havnt come across this problem before).
I'm using a jar of a different project to reference certain objects/
methods/actions from it.
The problem im getting is that one of the source files in the jar has
an internal class within it. ie, when compiled it gives
"theclassname.class" and also "theclassname$1.class": When accessing
this from another project, it doesnt seem to be able to compile its
own "theclassname$1.class" -
To be honest, i dont even understand how it uses' jars without
compiling the source code inside.
Could anyone give me some expert knowledge in this area? My google
skills are again severley lacking when trying to find this stuff out.
Graeme
Lew - 05 Dec 2007 15:19 GMT
> Hello everyone,
>
[quoted text clipped - 7 lines]
> an internal class within it. ie, [sic] when compiled it gives
> "theclassname.class" and also "theclassname$1.class": When accessing
That should be "TheClassName", by convention.
> this from another project, it doesnt seem to be able to compile its
> own "theclassname$1.class" -
>
> To be honest, i dont even understand how it uses' jars without
> compiling the source code inside.
JARs come with the code already compiled. They usually don't even have source
code inside them.

Signature
Lew
gwoodhouse@gmail.com - 06 Dec 2007 15:42 GMT
> gwoodho...@gmail.com wrote:
> > Hello everyone,
[quoted text clipped - 22 lines]
> --
> Lew
Thanks again guys,
Was a silly mistake on my part by not checking the jar. It has
compiled with all the classes /except/ the inner classes. Why that is,
i have no idea but if i had to blame someone it would be eclipse! >:)
Graeme
Roedy Green - 06 Dec 2007 10:08 GMT
On Wed, 5 Dec 2007 05:37:49 -0800 (PST), "gwoodhouse@gmail.com"
<gwoodhouse@gmail.com> wrote, quoted or indirectly quoted someone who
said :
>When accessing
>this from another project, it doesnt seem to be able to compile its
>own "theclassname$1.class" -
What do you mean by this? The place where a class is defined compiles
into a class file that would have such a $1 name. In another class
that referenced the inner class, there would be no member of that
name, just a reference in the class file to that name.

Signature
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
Juha Laiho - 06 Dec 2007 11:27 GMT
"gwoodhouse@gmail.com" <gwoodhouse@gmail.com> said:
>I'm using a jar of a different project to reference certain objects/
>methods/actions from it.
[quoted text clipped - 7 lines]
> To be honest, i dont even understand how it uses' jars without
>compiling the source code inside.
Err... apparently then you've grabbed the source jar of the other project.
If that is the case, then _you_ should compile it first before using it.
Typically, I don't expect seeing any source code in jar files I'm using at
runtime (though I do know cases where the distribution jar of a piece of
software is built to include both the source and executable code, but
I'm not too fond of this practice.

Signature
Wolf a.k.a. Juha Laiho Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)