Troubleshooting the development environment
General Tips
- Check that all your paths and devices are correct (don't forget C:\Program Files\J2ME-Polish\global.properties)
- Attempt a clean build (run Clean in build.xml)
- Attempt a clean RMS (run CleanRMS in build.xml)
- Attempt doing a fresh check-out into a separate local folder and copying over your changes
Error
During the app build process I see this error:
[j2mepolish] java.io.IOException: CreateProcess: preverify.exe -classpath "C:\Program Files\J2ME-Polish\import\mmapi.jar;C:\Program Files\J2ME-Polish\import\midp-2.0.jar;C:\Program Files\J2ME-Polish\import\cldc-1.1.jar;C:\Program Files\J2ME-Polish\import\mmapi.jar;C:\Program Files\J2ME-Polish\import\wmapi.jar;C:\Program Files\J2ME-Polish\import\pdaapi.jar" -d "C:\Documents and Settings\jjackson\j2me-workspace\JavaProtocolSupport\build\real\Generic\DefaultColorPhone\en\classes" -nofinalize -nonative "C:\Documents and Settings\jjackson\j2me-workspace\JavaProtocolSupport\build\real\Generic\DefaultColorPhone\en\classes" error=2 [j2mepolish] at java.lang.ProcessImpl.create(Native Method) [j2mepolish] at java.lang.ProcessImpl.<init>(ProcessImpl.java:81) [j2mepolish] at java.lang.ProcessImpl.start .....
Solution
The build process can't find you preverify.exe file, your wtk.home property in build.properties is pointing to the wrong folder. The default installation directory is c:\wtk2.5.2
Error
During the app build process I see this error:
cannot find com.sun.tools.javac .....
Solution
Your eclipse environment is pointing to a JRE java runtime instead of a JDK runtime. Right click on the project->build path->add Libraries. Click on JRE System Library. Select 'Alternate JRE' and add your JDK. If its not in the drop down, click on Installed JREs and navigate to your JDK.
Error
When trying to build, I see this:
BUILD FAILED D:\Eclipse Workspace\JavaProtocolSupport\build.xml:30: Unable to compile source code for device [Generic/Midp2Cldc11Pointer]: Unable to find a javac compiler; com.sun.tools.javac.Main is not on the classpath. Perhaps JAVA_HOME does not point to the JDK
Solution
In Eclipse, you fix this by:
Going to Eclipse Preferences -> Ant -> Runtime, select "Global Entries" under the "Classpath" tab, click "Add External JARs", and add "tools.jar" (found in the \lib directory under your JDK installation, i.e., C:\Program Files\Java\jdk_[version]\lib\).
Error
You may get an error with your build bath. These is do to some quirky behave with eclipse and how the project is setup. If you get this, right click on the Project:
Solution
- Go to properties->Java Build Path.
- Click on something that will alter the classpath file (e.g. click the checkbox next to Junit 3 on the order and export tab)
- Click OK
- Open the properties back up, under you change (e.g. unclick the checkbox next to Junit 3)
- Click OK. This should remove the build errors
Error
When I try to run the code on a Nokia Series 40 phone, it immediately crashes with a 'NoSuchMethodException'
Solution
This is due to a bug in Nokia's JVM and has been worked around in the latest code.
Error
When I build, Polish.AntTask fails saying something about not being able to copy a file correctly into the 'build' directory.
Solution
Abandon your local branch, check it out fresh and copy your changes over by hand.
