Java-Gaming.org Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (808)
Games in Android Showcase (239)
games submitted by our members
Games in WIP (872)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Exporting resources in a jar file  (Read 1697 times)
0 Members and 1 Guest are viewing this topic.
Offline AppleSauce
« Posted 2014-05-28 11:35:25 »

From my understanding, a jar file is basically a zip file that's compressed to run using each other.

How I load my resources
1  
wood = TextureLoader.getTexture("PNG", ResourceLoader.getResourceAsStream("res/wood.png"));


I have a folder that's not under the src folder, it's its' own foflder. example:

scr
     packages

res
libs


I figured it out using this syntax, but forgot. Right now I have a jar file in a folder with the res folder. How can I make the jar file hold everything itself.(Such as minecraft and other downloadable java games) Whenever I export it cmd tells me it couldn't find the textures.


exception:
1  
2  
3  
4  
5  
Exception in thread "main" java.lang.RuntimeException: Resource not found: ./res
/FlubberFlap.png
        at org.newdawn.slick.util.ResourceLoader.getResourceAsStream(ResourceLoa
der.java:69)
        at com_FlubberSpace.Game.main(MainFS.java:87)


Can you also explain what happens when I put ./ and / before the res.
Offline Riven
Administrator

« JGO Overlord »


Medals: 1371
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #1 - Posted 2014-05-28 14:10:44 »

FAQ: cannot find the resource/file

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings!
Offline AppleSauce
« Reply #2 - Posted 2014-05-28 14:31:20 »

I'm away from my pc atm. What if I'm 100% sure there is no problem with the res and there is no copy of it? If there is no problem with it, what could be the matter? Huh
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Riven
Administrator

« JGO Overlord »


Medals: 1371
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #3 - Posted 2014-05-28 15:00:51 »

If there would be no problem, it would work. Stare

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings!
Pages: [1]
  ignore  |  Print  
 
 

 
Riven (847 views)
2019-09-04 15:33:17

hadezbladez (5791 views)
2018-11-16 13:46:03

hadezbladez (2603 views)
2018-11-16 13:41:33

hadezbladez (6207 views)
2018-11-16 13:35:35

hadezbladez (1499 views)
2018-11-16 13:32:03

EgonOlsen (4734 views)
2018-06-10 19:43:48

EgonOlsen (5792 views)
2018-06-10 19:43:44

EgonOlsen (3276 views)
2018-06-10 19:43:20

DesertCoockie (4175 views)
2018-05-13 18:23:11

nelsongames (5501 views)
2018-04-24 18:15:36
A NON-ideal modular configuration for Eclipse with JavaFX
by philfrei
2019-12-19 19:35:12

Java Gaming Resources
by philfrei
2019-05-14 16:15:13

Deployment and Packaging
by philfrei
2019-05-08 15:15:36

Deployment and Packaging
by philfrei
2019-05-08 15:13:34

Deployment and Packaging
by philfrei
2019-02-17 20:25:53

Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!