当前位置: 技术问答>java相关
如何实现%%文件读取
来源: 互联网 发布时间:2017-04-29
本文导语: 我在win2000中设置环境变量set SUMIT_CONFIG=c:sumit 然后想在java代码中实现 File file = new File("%SUMIT_CONFIG%\config.xml"); 运行程序后报错 log4j:ERROR Could not read configuration file [%SUMIT_CONFIG%/log4j.txt]. java.io.FileNotFoundException: %S...
我在win2000中设置环境变量set SUMIT_CONFIG=c:sumit
然后想在java代码中实现
File file = new File("%SUMIT_CONFIG%\config.xml");
运行程序后报错
log4j:ERROR Could not read configuration file [%SUMIT_CONFIG%/log4j.txt].
java.io.FileNotFoundException: %SUMIT_CONFIG%/log4j.txt (The system cannot find the path specified)
然后想在java代码中实现
File file = new File("%SUMIT_CONFIG%\config.xml");
运行程序后报错
log4j:ERROR Could not read configuration file [%SUMIT_CONFIG%/log4j.txt].
java.io.FileNotFoundException: %SUMIT_CONFIG%/log4j.txt (The system cannot find the path specified)
|
你是不能从win2000的环境中得到的,因为系统通过System.getProperties()只能得到如下的东东:
java.version
java.vendor
java.vendor.url
java.home
java.vm.specification.version
java.vm.specification.vendor
java.vm.specification.name
java.vm.version
java.vm.vendor
java.vm.name
java.specification.version
java.specification.vendor
java.specification.name
java.class.version
java.class.path
java.library.path
java.io.tmpdir
java.compiler
java.ext.dirs
os.name
os.arch
os.version
file.separator
path.separator
line.separator
user.name
user.home
user.dir
java.version
java.vendor
java.vendor.url
java.home
java.vm.specification.version
java.vm.specification.vendor
java.vm.specification.name
java.vm.version
java.vm.vendor
java.vm.name
java.specification.version
java.specification.vendor
java.specification.name
java.class.version
java.class.path
java.library.path
java.io.tmpdir
java.compiler
java.ext.dirs
os.name
os.arch
os.version
file.separator
path.separator
line.separator
user.name
user.home
user.dir
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。