【发布时间】:2014-05-01 09:22:07
【问题描述】:
我正在编写不属于我的代码,我希望能够使用 cmd 在其他计算机上运行它。 在eclipse上我们使用这个
MazeWritable maze = new MazeWritable("layouts/mediumClassic.lay");
要引用布局,如果我通过不同的调用,它会变成这样:
public MazeWritable(String filename) throws MazeException
{
super(filename);
}
然后超级去
public Maze(String filename) throws MazeException
{
try{
System.out.println("Layout file is "+filename);
//Lecture du fichier pour déterminer la taille du maze
InputStream ips=new FileInputStream(filename);
InputStreamReader ipsr=new InputStreamReader(ips);
BufferedReader br=new BufferedReader(ipsr);
当我尝试使用 eclipse 为我的项目制作一个可运行的 jar 时,它不包括文件 layouts/,它在项目中位于引用的库旁边,即使我尝试将其放入 cmd它不想看到它,我错过了什么吗? 我尝试使用清单,但它不起作用(而且我不确定我在做什么)。
谢谢
【问题讨论】: