System.out.println does not print on netbeans console
Asked Answered
J

6

7

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?

Judicature answered 6/9, 2011 at 6:28 Comment(0)
F
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.

Fiedling answered 6/9, 2011 at 7:10 Comment(1)
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.Delineator
W
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;
Wanderlust answered 6/8, 2012 at 17:34 Comment(2)
This was the solution I was looking for and in my opinion this should be validated as the answer. Thanks.Leftwich
I disagree. This will actually have no effect on the code's behavior vis-a-vis output appearing or not. (And if it appears that it does have an effect ... it is a coincidence. The more likely explanation is that your IDE got into a funny state, and changing / recompiling the code "magically" cleared it. IDEs are like that sometimes ...)Materi
V
1

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

Vertebral answered 8/2, 2013 at 1:46 Comment(0)
N
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");
    }

}
Numberless answered 6/9, 2011 at 13:15 Comment(1)
There is no error. I used properly. I'm facing this issue when I use blackberry with LWUIT on netbeans.Judicature
H
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

Hadrian answered 21/6, 2013 at 13:1 Comment(0)
I
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

Innate answered 13/5, 2014 at 20:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.