Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help on Preverify process

 
Ramesh Piyathilaka
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All,

I am new to j2me programming, I am getting this error when I run the preverify command

set path=d:\j2sdk1.4.2_04\bin;d:\j2me\midp1.0.3fcs\bin;

set classpath=d:\j2me\midp1.0.3fcs\classes;
set MIDP_HOME=d:\j2me\midp1.0.3fcs;



D:\j2me\j21>preverify -classpath d:\j2me\midp1.0.3fcs\classes;. -d . Myfirst
Error preverifying class Myfirst
Class loading error: Illegal constant pool index

D:\j2me\j21>javac -classpath d:\j2me\midp1.0.3fcs\classes;. -d . Myfirst.java

D:\j2me\j21>preverify -classpath d:\j2me\midp1.0.3fcs\classes;. -d . Myfirst
Error preverifying class Myfirst
Class loading error: Illegal constant pool index

when I run preverify i am getting this error please can some one assist me on this issue.

Regards
Ramesh

D:\j2me\j21>
[ January 04, 2006: Message edited by: Ramesh Piyathilaka ]
 
Joyce Lee
Ranch Hand
Posts: 1392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ramesh,

D:\j2me\j21>javac -classpath d:\j2me\midp1.0.3fcs\classes;. -d . Myfirst.java

When compiling a midlet, use bootclasspath option to override the default java.lang package used by the standard JDK, like this:



when I run preverify i am getting this error please can some one assist me on this issue.
I couldn't reproduce the same error by running the exact commands you've stated above, unless I meddled the *.class file. I'm using JDK 5.0 and MIDP 2.0.

I googled and found that someone encountered the same error as you did. The suggested solution is to add "target 1.1" option to the javac command.
http://forum.java.sun.com/thread.jspa?forumID=76&messageID=1020368&threadID=267182

A nice article on creating a midlet without the toolkit.

Joyce
[ January 05, 2006: Message edited by: Joyce Lee ]
 
Ramesh Piyathilaka
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"thank you a million time for the replym, but the error still exsist please can some one guide me on this issue.

Originally posted by Joyce Lee:
Hi Ramesh,

D:\j2me\j21>javac -classpath d:\j2me\midp1.0.3fcs\classes;. -d . Myfirst.java

When compiling a midlet, use bootclasspath option to override the default java.lang package used by the standard JDK, like this:



when I run preverify i am getting this error please can some one assist me on this issue.
I couldn't reproduce the same error by running the exact commands you've stated above, unless I meddled the *.class file. I'm using JDK 5.0 and MIDP 2.0.

I googled and found that someone encountered the same error as you did. The suggested solution is to add "target 1.1" option to the javac command.
http://forum.java.sun.com/thread.jspa?forumID=76&messageID=1020368&threadID=267182

A nice article on creating a midlet without the toolkit.

Joyce

[ January 05, 2006: Message edited by: Joyce Lee ]
 
Joyce Lee
Ranch Hand
Posts: 1392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ramesh, I've received your e-mail. Changing the classpath to bootclasspath will not solve the problem, it only overrides the java.lang package used by standard JDK. Go to the directory d:\j2me\midp1.0.3fcs\classes, you'll see a smaller version of the java.lang package used by the midlet.

Did you add the "target 1.1" option to the javac as suggested in the Sun forum? Like this:



Googled for "Illegal constant pool index" preverify and found the following hits:
http://archives.java.sun.com/cgi-bin/wa?A2=ind0404&L=kvm-interest&F=&S=&P=6530
http://www.maf.vu.lt/~bastys/java/paskaitos/8/WirelessJava.htm
http://forum.java.sun.com/thread.jspa?forumID=54&messageID=1411940&threadID=342615
http://forum.java.sun.com/thread.jspa?forumID=76&messageID=1020368&threadID=267182

Joyce
[ January 06, 2006: Message edited by: Joyce Lee ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic