System.out.println 不在 netbeans 控制台上打印

发布于 2024-12-02 20:54:52 字数 187 浏览 2 评论 0原文

我使用 Netbeans 7.0 通过 LWUIT 框架开发 Blackberry 应用程序。我正在使用 Blackberry SDK 4.7。我在应用程序的许多地方使用 System.out.println(...); 打印字符串。但字符串值不会打印在 netbeans 控制台上。

有什么问题吗?如何解决这个问题?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

心房敞 2024-12-09 20:54:52

我不使用 Netbeans,但在 Eclipse 中,控制台打印仅在您开始调试项目时才有效(调试为 > Blackberry Simulator),并且在运行(运行为 > Blackberry Simulator)您的项目时不起作用。即,如果调试器未与模拟器连接,则 System.out.println(...) 不起作用。

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.

最近可好 2024-12-09 20:54:52

我刚刚在 netbeans 7.2 的 Java 控制台应用程序中首先使用了

导入语句:

  import static java.lang.System.out;

稍后当您想编写一些输出时,请使用:

 out.println;

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;
老街孤人 2024-12-09 20:54:52

在 NetBeans 7.2 中尝试“清理项目”(锤子/扫帚图标)

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

魂ガ小子 2024-12-09 20:54:52

Netbeans 很好,不用担心。您所需要做的就是通过单击构建按钮确保正确构建源代码!这会告诉你所有的错误。
在顶部,确保添加

package "your-project-name";


public class your-project-name {

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

}

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");
    }

}
浅笑轻吟梦一曲 2024-12-09 20:54:52

您必须转到文件 ->运行文件,
也许你有另一个主程序,你没有注意到它是空的,然后用“运行”来运行它。
然后“运行文件”,您指定您想要这个主文件,而不是另一个预生成的空文件。

维克多

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

め七分饶幸 2024-12-09 20:54:52

在netbeans中我使用.... Windows>Output>ADB Log,你可以看到我也设置的日志 Log.i("your custom tag","your custom message");而不是 System.out.println("your message")

希望这有帮助

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文