简体   繁体   English

将文件从autoexec jar复制到java.io.tmpdir

[英]Copy files from an autoexec jar to java.io.tmpdir

I'm trying to copy two local files from my jar to the java temp dir defines like that : 我试图将两个本地文件从我的jar复制到java temp dir定义中,如下所示:

String strDirectoy = System.getProperty("java.io.tmpdir") + path;

It works great when I launch it from eclipse, but when I try to launch it from the exported autoexec jar, it does'nt work ! 当我从eclipse启动它时,它很好用,但是当我尝试从导出的​​autoexec jar中启动它时,它不起作用!

Did I missed something ? 我错过了什么吗?

Ok I know what I've done wrong : - First : eclipse does'nt export my own files (the ones I wanted to copy) So I have to copy them in the jar manually after it had been exported by eclipse. 好的,我知道我做错了什么:-首先:eclipse不会导出我自己的文件(我想要复制的文件),因此在被eclipse导出后,我必须手动将其复制到jar中。

  • Second : I have to put them in the main directory of the jar, if I don't do that, java can't find the files in question. 第二:我必须将它们放在jar的主目录中,如果不这样做,java找不到有问题的文件。

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

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