在 eclipse 中调试时从小程序写入日志
我正在尝试从小程序写入日志文件。
当作为 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该在临时文件中编写小程序中想要的任何内容,以创建临时文件 尝试这个< /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.