Eclipse _mthclass$ problem  
Author Message
klewta





PostPosted: 2004-1-29 7:04:00 Top

java-programmer, Eclipse _mthclass$ problem 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





PostPosted: 2004-1-31 0:40:00 Top

java-programmer >> Eclipse _mthclass$ problem -----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 28/01/2004 6:03 PM, Monkeyshyne wrote:

> 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?

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]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (MingW32)

iD8DBQFAGojyuSy542G+Z7QRAhHEAJ0ftISBihldJ74ut5Vg9eWAB2WBiwCfTLMU
HxF+G7umGCPzPztMAoQVj6U=
=6x8k
-----END PGP SIGNATURE-----