我试图将程序部署到可执行的jar文件中。当我直接从IDE (IntelliJ)运行程序时,一切都很好。但是,在我将 jar 文件从我的项目中生成之后,当我运行该jar文件时,我会得到以下错误:
java.io.FileNotFoundException: src\JsonFiles\Words.json (The system cannot find the path specified)
我导出了一个读取2个配置文件的项目。但是,当我执行jar时,它得到这个错误:
Error: java.io.FileNotFoundException: config/dbConnection.config (No such file or directory)
Error: java.io.FileNotFoundException: config/test.config (No such file or directory)
com.smart.ets.services.ServiceException: com.smart.ets.services.ConfigE
我的代码:
BufferedInputStream bis =
new BufferedInputStream(getClass().getResourceAsStream("playerhit.mp3"));
当playerhit.mp3文件与运行它的MP3.class位于同一个包中时,此代码可以很好地工作。我以.jar的身份运行。如果我将文件路径更改为类似于/src/data/audio/playerhit.mp3的内容,它将不再起作用。在以.jar身份运行时,有没有办法访问包的根目录以外的其他文件路径?
在用命令行编译Java文件时遇到了一些技术问题。
我把这两个.java文件放在同一个目录中
// Source.java
package home;
public class Source {
public Source(){
System.out.println("This is the source.");
}
public static void main(String[] s){
System.out.println("this is England.");
System.out.println("
在我的游戏中,我有以下代码:
public Main() { p = new Potato(); addKeyListener(new AL()); setFocusable(true); ImageIcon i = new ImageIcon("C:/test.png"); img = i.getImage(); time = new Timer(5, this);
我正尝试在我的Ubuntu机器上本地运行Codename One,这样我就不用把构建发送到codenameone.com了。我遵循了本教程中的步骤:
并全部安装成功。当我转到我的项目目录并运行:
ant build-for-android-device-locally
我得到以下错误:
/home/petr/projects/MyApp/dist/android/src/com/codename1/social/FacebookImpl.java:37: error: package com.facebook does not exist
因此,我下载了facebook sdk,使用Grad
大家好,我正在将项目集成到我的应用程序中,当我运行该应用程序时,我得到了以下错误
请帮我解决这个问题,谢谢!
org.thymeleaf.exceptions.TemplateInputException: Error resolving template "fragments/header", template might not exist or might not be accessible by any of the configured Template Resolvers (login:30)
at org.thymeleaf.TemplateReposi