创建jar文件时如何指定.txt文件路径? (netbeans) [英] How to specify the .txt fle path when create the jar file? (netbeans)

查看:226
本文介绍了创建jar文件时如何指定.txt文件路径? (netbeans)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我用Java创建游戏.我有一个文本文件,其中包含玩游戏所需的游戏值.当我从netbeans运行程序时,一切正常,但是当我创建一个.jar文件时,游戏无法读取该文件.如何指定此文件的路径,以便游戏(jar文件)可以找到并使用它?
谢谢..

Hello,

I create a game in java. I have a text file that contains values the game needed to play the game. when i run the program from the netbeans every thing work perfict but when i create a .jar file the game can not read this file. How to specify the path of this file so the game (jar file) can find it and use it??

Thank you..

推荐答案



我在此链接中找到了解决方法

http://www.coderanch.com/t/499632/java/java/load-file-jar-file [ ^ ]


谢谢
Hay

I found the solution in this link

http://www.coderanch.com/t/499632/java/java/load-file-jar-file[^]


thank you


这篇关于创建jar文件时如何指定.txt文件路径? (netbeans)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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