简体   繁体   English

安装路径

[英]path of installation

I have a problem. 我有个问题。 Im doing an installer for my program, but how I tell to class which is the path of installation 我正在为我的程序做安装程序,但是我如何告诉类这是安装路径

new FileInputStream(" pathInstallation /DESTest.txt") 新的FileInputStream(“ pathInstallation /DESTest.txt”)

Greetings 问候

how I stick the path on the classpath? 我如何将路径粘贴在classpath上?

Use Class.getResource or Class.getResourceAsStream methods. 使用Class.getResourceClass.getResourceAsStream方法。

The resource is any file which is located next to your compiled .class file. 该资源是位于已编译.class文件旁边的任何文件。 Pass the name of the file (without the path) to one of these methods and read its content. 将文件名(不带路径)传递给这些方法之一并读取其内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM