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 / Tools / January 2004

Tip: Looking for answers? Try searching our database.

Eclipse _mthclass$ problem

Thread view: 
Monkeyshyne - 28 Jan 2004 23:03 GMT
I have an issue with Eclipse not adding a static Class called
_mthclass$ to my compiled class file and when I compile the same
source using Ant with jdk 1.3 or 1.4 it adds this _mthclass$. I read
that Eclipse has its own javac to compile class files and that you
cannot change this. My classes are now incompatible during
Serialization. Has anyone come across a way to get Eclipse to add this
class or a work around?
Emir Alikadic - 30 Jan 2004 16:40 GMT
> I have an issue with Eclipse not adding a static Class called
> _mthclass$ to my compiled class file and when I compile the same
[quoted text clipped - 3 lines]
> Serialization. Has anyone come across a way to get Eclipse to add this
> class or a work around?

Eclipse does indeed have its own compiler that is an independent
implementation of the spec.  This means that bugs in Sun's implementation may
not necessarily appear in Eclipse and vice versa, as
https://bugs.eclipse.org/bugs/show_bug.cgi?id=37565 illustrates (Sun's Javac
was triggering a class initialization upon encountering a class literal,
whereas the spec says it shouldn't; Eclipse compiler was following the spec
which caused errors in code that relied on buggy Sun implementation).

One workaround is to make sure you use same compiler on both ends.  If you
decide to use Sun's javac, you need to use Ant within Eclipse (right-click on
build.xml in Package Explorer and select Run Ant) which will use javac from
whatever J2SE SDK you have currently selected.  Selecting Project -> Build
Project/All in the menu will use the internal Eclipse compiler.
- --
Emir Alikadic
Software Developer
CollectiveBid Systems Inc.

"If you think technology can solve your problems, then you don't understand
your problems and you don't understand technology."       [Bruce Schneier]


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



©2008 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.