[1.1.1] images not found in runnable jar at root level --- fixed 1.1.1 nightly 2016-12-10
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SikuliX |
Fix Committed
|
Critical
|
RaiMan |
Bug Description
Hello all,
I'm currently running Eclipse Mars.2 Release (4.5.2) with the 64-bit jdk1.7.0_79. I am not building a Maven project (that I'm aware of). I simply started a brand new Java Project in Eclipse and imported the Sikuli jar into the project.
I ran the following block of code that helped me to narrow down my setBundlePath options (I think):
String clazz = "testAPI.Test";
String imgFolder = "/imgs";
String img = "test.png";
String inJarFolder = clazz + imgFolder;
if (ImagePath.
else {
}
Sorry about the formatting above, I'm not sure how to get it to show in blocks.
But any way, that little block of code came from http://
ImagePath.
ImagePath.
My current project structure looks like this:
[Main Project Name]
-> src
->-> (default package)
->->-> Main.java
-> resources
->-> image1.png
->-> image2.png
->-> image3.png
->-> etc...
When I run the project in Eclipse, it works perfectly. No issues at all. However, when I export this as a runnable jar (with the Library Handling: option set to "Package required libraries into generated JAR") and then subsequently run it like "java -jar [File.jar]" I get the following errors:
Exception in thread "main" java.lang.
at sun.reflect.
at sun.reflect.
at sun.reflect.
at java.lang.
at org.eclipse.
der.java:58)
Caused by: java.lang.
at Main.main(
... 5 more
Caused by: java.lang.
at org.sikuli.
at org.sikuli.
at org.sikuli.
at org.sikuli.
at org.sikuli.
... 6 more
I'm assuming this has to do with it not being able to find the images. When I open the jar with 7-zip, all of the images are in the root of the jar as well as "Main.class" -- so I thought I had this thing setup right.
Can anyone help me with this? I'm needing to get this solved drastically as I'm so sick of working with it... Thank you so very much for whatever help I can get!
Changed in sikuli: | |
status: | New → Fix Committed |
importance: | Undecided → High |
assignee: | nobody → RaiMan (raimund-hocke) |
milestone: | none → 1.1.1 |
Changed in sikuli: | |
importance: | High → Critical |
summary: |
- [1.1.1] images not found in runnable jar at root level --- use at least - one folder level + [1.1.1] images not found in runnable jar at root level --- fixed 1.1.1 + nightly 2016-12-10 |