Java应用程序启动路径 [英] Java Application Start Path

查看:248
本文介绍了Java应用程序启动路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



最后,我完成了我的毕业设计。我正在增加一些设施。但是,ı遇到了问题。在读取一些文件夹或文件时,.net中有一个代码行。当我们编写Application.StartupPath时...项目指示用户proje\bin\debug文件夹。这样,我想使用相同的工具。我有一个resources.rar文件夹。当用户点击下载应该下载的源链接。但是,我使用自己的路径C:Users / Emre / etc ...



有没有办法解决这个问题?



谢谢。

解决方案

是的。你需要使用相对路径,而不是绝对路径。 br />
应该有一个包ResourceBundle这样做。请检查。



如果你从另一个目的地(某些.net app)链接),你应该使用一个属性来配置一个合适的路径。


为了记录:我相信我在这里回答:提高程序的可移植性 [ ^ ]。



-SA

Hello everyone,

Finally, I finished my graduation project. I am putting some extra facilities. However, ı faced with a problem. There was a code line in .net while reading some folders or files. when we wrote Application.StartupPath... the project directs the user "proje\bin\debug folder. In this manner, I want to use the same facility. I have a resources.rar folder. When the user clicked on the download the source link this should be downloaded. However, I am using my own path C:Users/Emre/etc...

Is there any way to solve this?

Thank you.

解决方案

Yes. You need to use relative paths, not absolute.
There should be a package ResourceBundle for doing so. Please check that.

If you are linking in from another destination (some .net app), you should use a property for configuring a decent path.


For the record: I believe I answered here: Raising the portability of program[^].

—SA


这篇关于Java应用程序启动路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆