Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / December 2007

Tip: Looking for answers? Try searching our database.

Inner Class's

Thread view: 
gwoodhouse@gmail.com - 05 Dec 2007 13:37 GMT
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)



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.