你好朋友...
我已经开发了一个包含示例音频测试代码的JAR文件. JAR文件包含一个名为wavfile的文件夹,该文件夹保存项目的wavefile.我曾经通过在其中添加以下代码来获取JAR的当前目录:
I have developed a JAR file that contains the sample audiotesting code. The JAR file contains a folder called wavfile which holds the wavefiles of the project. I used to get the current dir of the JAR by adding the follwing code into it:
System.getProperties("User.dir"+"\\WavFile");但是当我尝试在另一个Windows系统中运行此文件时,该文件无法正常工作.
But when I try to run this file in another Windows system it is not working.
代码搜索jar加载到的wavefile
The code searches for the wavefile where the jar has been loaded
例如:如果我在C:\\中加载JAR文件,则代码在C:\\中而不是在JAR文件中搜索wavefile文件夹,并抛出错误
For example: If I load my JAR file in C:\\ then the code searches for the wavefile folder in C:\\ and not inside the JAR file and throws me the error
File not found:C:\\WavFile\\English\\mysound.wav对我有什么想法.....
Any ideas for me .....
推荐答案您需要先提取文件. 这个站点应该可以帮助您从存档中取出文件. You need to extract the file first. This site should help you with getting the file out of the archive.
更多推荐
访问JAR文件夹中的文件
发布评论