J2ME-Polish2.0RC4 对doja的支持不是很好。 建议采用
j2mepolish-2.0-Preview.jar。
回复:关于需要指定 libraryjars的问题,理解polish原理即可。
见build.xml里的binaryLibraries="${polish.home}/import/midp-2.0.jar"
Hi Robert ,
Thank you .
i think j2mepolish is a very very great software ... it help me a lot . thank you and your team .
i had downloaded
j2mepolish-2.0-Preview.jar ,
it's work well in javac .
but i meet a error in proguard .
the prompt :
[j2mepolish] proguard: Warning: de.enough.polish.event.ThreadedEventListener: can't find superclass or interface javax.microedition.lcdui.CommandListener
[j2mepolish] proguard: Warning: de.enough.polish.event.ThreadedEventListener: can't find superclass or interface javax.microedition.lcdui.ItemCommandListener
[j2mepolish] proguard: Warning: de.enough.polish.event.AsynchronousCommandListener: can't find superclass or interface javax.microedition.lcdui.CommandListener
[j2mepolish] proguard: Warning: de.enough.polish.event.ThreadedCommandListener: can't find superclass or interface javax.microedition.lcdui.CommandListener
[j2mepolish] proguard: Warning: there were 4 unresolved references to superclasses or interfaces.
[j2mepolish] proguard: You may need to specify additional library jars (using '-libraryjars'),
[j2mepolish] proguard: or perhaps the '-dontskipnonpubliclibraryclasses' option.
[j2mepolish] proguard: If you are sure the mentioned classes are not used anyway,
[j2mepolish] proguard: you could try your luck using the '-ignorewarnings' option.
[j2mepolish] proguard: Error: Please correct the above warnings first.
i had used libraryjars or ignorewarnings or dontskipnonpubliclibraryclasses just like prompt above ,
(
<parameter name="ignorewarnings" value="true"/>
or
<parameter name="dontskipnonpubliclibraryclasses" value="true" />
or
<parameter name="libraryjars" value="${polish.home}/import/cldc-1.0.jar
;${polish.home}/import/doja-2.5.jar" />
)
but i meet these error prompt:
[j2mepolish] java.lang.IllegalArgumentException: To use the parameter [ignorewarnings] the class [de.enough.polish.obfuscate.ProGuardObfuscator] needs to specify the method setIgnorewarnings(String), setIgnorewarnings(boolean) or setIgnorewarnings(File).
[j2mepolish] at de.enough.polish.util.ReflectionUtil.populate(ReflectionUtil.java:195)
[j2mepolish] at de.enough.polish.util.ReflectionUtil.populate(ReflectionUtil.java:160)
[j2mepolish] at de.enough.polish.Extension.getInstance(Extension.java:314)
[j2mepolish] at de.enough.polish.ExtensionManager.getExtension(ExtensionManager.java:357)
[j2mepolish] at de.enough.polish.ExtensionManager.getExtension(ExtensionManager.java:273)
[j2mepolish] at de.enough.polish.ExtensionManager.getExtension(ExtensionManager.java:216)
[j2mepolish] at de.enough.polish.obfuscate.Obfuscator.getInstance(Obfuscator.java:111)
[j2mepolish] at de.enough.polish.ant.PolishTask.initProject(PolishTask.java:1029)
[j2mepolish] at de.enough.polish.ant.PolishTask.execute(PolishTask.java:333)
[j2mepolish] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
[j2mepolish] at org.apache.tools.ant.Task.perform(Task.java:364)
[j2mepolish] at org.apache.tools.ant.Target.execute(Target.java:341)
[j2mepolish] at org.apache.tools.ant.Target.performTasks(Target.java:369)
[j2mepolish] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
[j2mepolish] at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
[j2mepolish] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
[j2mepolish] at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
[j2mepolish] at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
[j2mepolish] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
[j2mepolish] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
BUILD FAILED
D:/jDKDoJa2.5/apps/testNetWork/build/build.xml:131: Unable to initialize the obfuscator [ProGuard/null]: java.lang.IllegalArgumentException: To use the parameter [ignorewarnings] the class [de.enough.polish.obfuscate.ProGuardObfuscator] needs to specify the method setIgnorewarnings(String), setIgnorewarnings(boolean) or setIgnorewarnings(File).
I tried a lot , but i don't know how to do yet .
Sorry , my english is bad .
Many thanks for your help .
----- Original Message -----
From: Enough Software Support
To: powinder
Sent: Friday, April 13, 2007 4:46 PM
Subject: Re: I think I have found a bug in j2mepolish javac
Hi Powinder,
thanks - this is fixed in the CVS. You can get a new version here:
http://www.j2mepolish.org/mobile/j2mepolish-2.0-Preview.jar
Best,
 Robert
On Apr 13, 2007, at 7:52 , powinder wrote:
hi all :
Â
Â
Â
i used doja develop . Â
Â
i find in /J2ME-Polish2.0RC4/j2mepolish-src/j2me/src/de/enough/polish/io/Serializer.javaÂ
Â
Â
...
490 line
Â
     Externalizable[] externalizables;
Â
     //#if polish.midp
       externalizables = new Externalizable[ length ];
     //#endif
Â
     //#if polish.JavaSE
       try {
         externalizables = (Externalizable[]) Array.newInstance(Class.forName( cn ), length);
       } catch (Exception e) {
         //#debug error
         System.out.println("Unable to instantiate Serializable /"" + cn + "/"" + e);
         throw new IOException( e.toString() );
       }
     //#endif
    Â
   Class[] classes = new Class[ Math.min( length, 7 ) ];
   Class currentClass;
   byte idCounter = 0;
   for (int i = 0; i < externalizables.length; i++) {
Â
        ...
Â
   }
Â
...
Â
i use doja ,not polish.midp .
Â
so variable externalizables might not have been initialized .
Â
Â
what can i do ?
Â
Â
Â
Â
Â
Â
Â
Â
Â
----- Original Message -----
From:
powinder
Sent:
Friday, April 13, 2007 1:31 PM
Subject:
I think I have found a bug in j2mepolish build
I think I have found a bug.
Serializer.java:509: variable externalizables might not have been initialized.
Â
   [javac] for (int i = 0; i <               Â
                   externalizables.length; i++) {
   [javac] ^
   [javac] 1 error
--
Robert Virkus
CEO Enough Software
Sögestr. 70
28195 Bremen
Germany