在 eclipse 中调试时从小程序写入日志

发布于 2024-11-16 20:23:06 字数 206 浏览 7 评论 0原文

我正在尝试从小程序写入日志文件。

当作为 Java 应用程序运行时,我能够写入文件, 但是当作为小程序运行时,我得到 .\logs\test.log (系统找不到指定的路径)

如何使用 eclipse 在调试时允许它写入磁盘?

编辑:是因为反斜杠吗?

I am trying to write a log file from an applet.

When running as a Java application, I am able to write to the files,
but when running as an applet, I get .\logs\test.log (The system cannot find the path specified).

How do I permit it to write to disk, while debugging using eclipse?

EDIT: is it because of the backslashes?

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

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

发布评论

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

评论(1

这个俗人 2024-11-23 20:23:06

您应该在临时文件中编写小程序中想要的任何内容,以创建临时文件 尝试这个< /a>
。此外,您还可以在 java 中获取系统临时文件夹并在其中创建文件,
阅读此内容。 @Yoni 是对的,当您在小程序中时,您的权限有限。

You should write whatever you want from applet in temp file, to create temp file Try this
. Also you get system temp folder in java and create your file there, Read this. @Yoni is right you have limited permissions when you are in applet.

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