简体   繁体   English

如何引用资源文件

[英]How to reference a resource file

I have two exe's that I want to reference once I build the package into a JAR. 将程序包构建到JAR中后,我要引用两个exe。 My structure looks like the following: 我的结构如下所示:

Project 项目

  1. build 建立
  2. dist dist
  3. nbproject nb项目
  4. src src
    • myProject 我的项目
      • Main.java Main.java
    • resources 资源
      • 1.exe 1.exe
      • 2.exe 2.exe

How can I get the file paths of 1.exe and 2.exe from Main.java? 如何从Main.java获取1.exe和2.exe的文件路径? Will this still work once I build the JAR? 一旦构建了JAR,这仍然有效吗?

生成jar时,可以使用META-INF / mainfest文件引用jar文件所需的所有必需资源。

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

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