6

I have used Netbeans 7.0 for developing Blackberry application with LWUIT framework. And I'm using Blackberry SDK 4.7. I print a string by using System.out.println(...); in my application in many places. But the string values aren't printed on the netbeans console.

What is the issue? How to resolve this issue?

Michael Donohue
  • 11,606
  • 5
  • 29
  • 44
bharath
  • 13,880
  • 16
  • 53
  • 93

6 Answers6

9

I don't use Netbeans, but in Eclipse console printing only works if you start debugging your project (Debug as > Blackberry Simulator), and it doesn't work while running (Run as > Blackberry Simulator) your project. i.e. if the debugger is not attached with the simulator then System.out.println(...) doesn't work.

Rupak
  • 3,674
  • 12
  • 23
  • 2
    This is correct for Netbeans as well. Just use Debug and output will appear in the RIM console (not the Netbeans console). The RIM simulator is by a huge margin the worst one in the industry, which is why LWUIT for RIM is so great... You can debug on SE/ME for 99% of the problems and avoid their horrible simulator. – Shai Almog Sep 08 '11 at 04:43
1

I have just used this in a Java Console App in netbeans 7.2

first the import statement:

  import static java.lang.System.out;

Later when you want to write some output use:

 out.println;
Andrew Barber
  • 37,547
  • 20
  • 91
  • 118
Sysnet
  • 11
  • 1
  • This was the solution I was looking for and in my opinion this should be validated as the answer. Thanks. – florin27 Mar 30 '21 at 18:42
0

In NetBeans 7.2 Try "cleaning the project" (hammer/broom icon)

0

You must go to File -> Run File, perhaps you have another main didn't you notice which is empty and with 'Run' you run that. Then 'Run File' you specify you want this main instead of another that is pregenerate and is empty.

Viktor

Viktor
  • 1
0

In netbeans I use.... Windows>Output>ADB Log and u can see log i set also Log.i("your custom tag","your custom message"); instead of System.out.println("your message")

Hope this helps

mavirroco
  • 107
  • 9
0

Netbeans is fine dont worry.. All you need to do is make sure you build your source code properly by clicking the build button! That will show you all your errors. At the top, make sure you add

package "your-project-name";


public class your-project-name {

public static void main(String[] args) {
    System.out.println("Hello World");
    }

}
arijeet
  • 1,688
  • 16
  • 26
  • There is no error. I used properly. I'm facing this issue when I use blackberry with LWUIT on netbeans. – bharath Sep 07 '11 at 05:13