preverify:ERROR: floating-point constants should not appear, while running the code in j2me using netbeans 6.9

StackOverflow https://stackoverflow.com//questions/9531364

all I am making a new project in J2ME-Polish2.1.4 and when I create a new project using J2ME-Polish2.1.4, the build is successful but when i run this code then I see the error about floating-point constants with more details below.

How to recover from this issue?

`J2ME Polish 2.1.4 (2010-01-18) (GPL License)
Loading device database...
Last build was interrupted or failed, now clearing work directory...
using locale [en_US]...
assembling resources for device [Nokia/7610].
preprocessing for device [Nokia/7610].
processing locale code... 
compiling for device [Nokia/7610].
warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
Compiling 428 source files to D:\Faraz\development\J2ME-Polish-Projectaaaa\build\test\Nokia\7610\en_US\classes
preverifying for device [Nokia/7610].
preverify:ERROR: floating-point constants should not appear
preverify:Error preverifying class de.enough.polish.ui.screenanimations.CubeScreenChangeAnimation
Preverify call failed: 1
C:\WTK2.5.1\bin\preverify.exe -classpath d:\J2ME-Polish2.1.4\import\mmapi.jar;d:\J2ME-Polish2.1.4\import\cldc-1.0.jar;d:\J2ME-Polish2.1.4\import\midp-2.0.jar;d:\J2ME-Polish2.1.4\import\nokia-ui.jar;d:\J2ME-Polish2.1.4\import\wmapi-2.0.jar;d:\J2ME-Polish2.1.4\import\wmapi.jar;d:\J2ME-Polish2.1.4\import\btapi.jar;d:\J2ME-Polish2.1.4\import\m3g.jar;d:\J2ME-Polish2.1.4\import\jsr172.jar;d:\J2ME-Polish2.1.4\import\fileconnection.jar;d:\J2ME-Polish2.1.4\import\pim.jar;d:\J2ME-Polish2.1.4\import\m2g.jar -d D:\Faraz\development\J2ME-Polish-Projectaaaa\build\test\Nokia\7610\en_US\classes -nofp -nofinalize -nonative D:\Faraz\development\J2ME-Polish-Projectaaaa\build\test\Nokia\7610\en_US\classes 
D:\Faraz\development\J2ME-Polish-Projectaaaa\build.xml:87: Unable to preverify for device [Nokia/7610] - preverify returned result 1
BUILD FAILED (total time: 9 seconds) 
`
有帮助吗?

解决方案

If you look deeper into preferify classpath, there is an indication of what caused the error.

C:\WTK2.5.1\bin\preverify.exe -classpath d:\J2ME-Polish2.1.4\import\mmapi.jar;d:\J2ME-Polish2.1.4\import\cldc-1.0.jar;d:\J2ME-Polish2.1.4\import\midp-2.0.jar;d:\J2ME-Polish2.1.4\import\nokia-ui.jar;d:\J2ME-Polish2.1.4\import\wmapi-2.0.jar;d:\J2ME-Polish2.1.4\import\wmapi.jar;d:\J2ME-Polish2.1.4\import\btapi.jar;d:\J2ME-Polish2.1.4\import\m3g.jar;d:\J2ME-Polish2.1.4\import\jsr172.jar;d:\J2ME-Polish2.1.4\import\fileconnection.jar;d:\J2ME-Polish2.1.4\import\pim.jar;d:\J2ME-Polish2.1.4\import\m2g.jar -d D:\Faraz\development\J2ME-Polish-Projectaaaa\build\test\Nokia\7610\en_US\classes -nofp -nofinalize -nonative D:\Faraz\development\J2ME-Polish-Projectaaaa\build\test\Nokia\7610\en_US\classes 

Above refers to cldc-1.0.jar meaning that your build is configured for CLDC 1.0 where floating point is not supported indeed. That's why your build fails.

To get it fixed, either get rid of floating point code in your application or use CLDC 1.1 that allows for float and double.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top