NetBeans ME compiler cannot access java.lang.StringBuilder

View: New views
2 Messages — Rating Filter:   Alert me  

NetBeans ME compiler cannot access java.lang.StringBuilder

by sjandre :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm just starting with NetBeans 6.7 having used Sun One Studio for several years.

I have many MIDP projects that run on Siemens' GSM modules, these were compiled on Sun One Studio using "Classic" compiler and a bootclasspath to runtime libraries for the module.



With the new NetBeans I have created a CLDC/MIDP project, and copied my existing source code and Ant scripts.

Attempting to compile generates the following message:





This version of java does not support the classic compiler; upgrading to modern

C:\java\work\Projects61\TC65_Midp\SmsIip\datatypes\MagArgDataType.java:101: cannot access java.lang.StringBuilder

class file for java.lang.StringBuilder not found

             + "                    Argument = " + Double.toString(arg) + "\r\n" ;

1 error

C:\java\work\Projects61\TC65_Midp\SmsIip\build.xml:86: Compile failed; see the compiler error output for details.

BUILD FAILED (total time: 0 seconds)



The runtime library for the device does not contain a StringBuilder class, string concatenation was done differently in earlier versions of Java.  

Is there any way to use an old "Java 1.1" or "Classic" style compiler with NetBeans?  

I never had any problems before with Sun One Studio.



I'd be grateful for any help



Best regards

Stephen





---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


NetBeans ME compiler cannot access java.lang.StringBuilder

by sjandre :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have now found a solution to my problem posted earlier, so I am posting it here as it may benefit someone else.



The problem lay with the Ant script, there are now additional <source> and <target> elements that should be specified within <javac>.



These should have been set to 1.2 and 1.1 respectively.  It is more efficient to use magic properties at the start of the Ant script:



        <property name="ant.build.javac.source" value="1.2"/>

        <property name="ant.build.javac.target" value="1.1"/>



This saves modifying each and every <javac> task.



Regards

Stephen





---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...