mike_hartshorn2 | 3 Sep 16:58
Picon
Favicon

Re: Thinlet and jdk1.1.8

Hi Michael,

if I compile the standard thinlet with Sun jdk1.1.8 I get
the errors shown below. Gammelgedden observes the same
and I've seen Robert Bajzat comment on the same point
in another message. Compiling with java 1.4.2 gives a
class file that works erratically with the java interpreter
of jdk1.1.8 (exceptions and vm crash).

As the fix is seemingly benign (adding public Thinlet()
in front of the instance initialiser on line 88)
it would be nice to have it in the standard distribution.

This helps maintain the portability of thinlet and would
certainly make my life easier :-)

Regards,

Mike

e:\thinlet\src> c:\jdk1.1.8\bin\javac thinlet\Thinlet.java
sun.tools.java.CompilerError: copyInline
        at sun.tools.tree.TryStatement.copyInline
(TryStatement.java:172)
        at sun.tools.tree.CompoundStatement.copyInline(Compiled Code)
        at sun.tools.tree.IfStatement.copyInline(IfStatement.java:95)
        at sun.tools.tree.CompoundStatement.copyInline(Compiled Code)
        at sun.tools.tree.InlineMethodExpression.copyInline
(InlineMethodExpression.java:67)
        at sun.tools.tree.MethodExpression.makeVarInits(Compiled Code)
        at sun.tools.tree.MethodExpression.checkValue(Compiled Code)
        at sun.tools.tree.MethodExpression.check(Compiled Code)
        at sun.tools.tree.ExpressionStatement.check(Compiled Code)
        at sun.tools.tree.Statement.checkBlockStatement(Compiled Code)
        at sun.tools.tree.CompoundStatement.check(Compiled Code)
        at sun.tools.tree.Statement.checkMethod(Compiled Code)
        at sun.tools.javac.SourceField.check(Compiled Code)
        at sun.tools.javac.SourceClass.checkFields(Compiled Code)
        at sun.tools.javac.SourceClass.checkInternal
(SourceClass.java:610)
        at sun.tools.javac.SourceClass.check(SourceClass.java:561)
        at sun.tools.javac.Main.compile(Compiled Code)
        at sun.tools.javac.Main.main(Main.java:465)
error: An error has occurred in the compiler; please file a bug 
report (http://java.sun.com/cgi-bin/bugreport.cgi).
1 error

--- In thinlet <at> yahoogroups.com, "Michael Nascimento Santos" 
<mister__m <at> h...> wrote:
> Maybe I missed a message, but have you tried compiling it with the 
java 1.1.8 compiler? Please let me know what happens.
> 
> Regards,
> -------------------------------------------------------------
> Michael Nascimento Santos
>   OK, I've done a bit more investigation.
>   Standard thinlet compiled with
> 
>   java version "1.4.2_03"
> 
>   and -target 1.1 produces a class file that is essentially
>   unusable with jdk1.1.8 under windows 2000.
> 
>   I get a constant stream of IllegalMonitorStateException's
>   and holding down a spin button causes a fatal JIT error
>   and vm crash.
> 
>   So I followed gammelgedden's advice and added the public
>   constructor as shown below. The code now compiles with
>   jdk1.1.8 and runs perfectly with the same vm under windows.
> 
>   Could we get this change incorporated into the main
>   distribution? It would be really nice to be able compile it
>   out of the box with jdk1.1.8.
> 
>   Mike
> 
>   --- In thinlet <at> yahoogroups.com, "gammelgedden" 
<gammelgedden <at> y...> 
>   wrote:
>   > It is possible to compile thinlet.java with Sun JDK 1.1.8 by 
doing 
>   a 
>   > very simple modification (or at least it was in teh previous 
>   > version).
>   > 
>   > The instance initialiser block in line 88 just after the static 
>   > initialiser block (line 82-87) is not accepted by the sun 
compiler.
>   > If you change it to be a proper constructor instead of an 
instance 
>   > initialiser it will work.
>   > 
>   > Add 'public Thinlet  ' in front of the starting bracket of the 
>   > initialiser block. It is in line 88 of the 'official' release 
of 
>   > thinlet.java. line 88 will then read
>   > public Thinlet {  
>   > instead of just 
>   > {
>   > 
>   > Actually I think this should be added to the code, because 
there is 
>   > no reason not to make it a proper public default constructor.
>   > 
>   > It worked alright when it was compiled with jdk 1.1.8.. 
Although I 
>   > admit that I have given up on jdk 1.1.8 and moved to 1.4
>   > 
>   > G

------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/nhFolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/thinlet/

<*> To unsubscribe from this group, send an email to:
    thinlet-unsubscribe <at> yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/


Gmane