Skip to main content
gamedev.net
🔒 Locked

Java problem..

Started by Kingstone426 May 23, 2003 at 2:19 AM 1 replies 500+ views
Original Post
Kingstone426
Kingstone426
Ok first of all I''m not sure if this is the right forum or even right community to post this problem but I''ve been surfing around for java forums for a few days with no good results. (If you''ve got a good link, please post it) I''ve got a kind of newbie problem. I''m using an IDE called Ellipse when developing and I''ve made a little test application for using javas Look & Feel Graphics Repository that conatins lots of standard icons. All you have to do to use it is to add a jar (jlfgr-1_0.jar) to the classpath and load images with lines of code like this: URL imageURL = getClass().getResource("/toolbarButtonGraphics/general/About16.gif"); This works perfectly while running in Eclipse but I can''t make it work when i export it to a standalone jar. I don''t even know if it doesn''t find jlfgr-1_0.jar or if it doesent find the icon inside, because the above line of code returns null in either case. No errors are shown. This is all info I can think of right now and I know it might not be sufficient but please help me. Any comments or suggestions are welcome.
Aldacron
Aldacron
When running the app outside of Eclipse, you need to make sure that any jars you added to the project''s classpath are also in the JRE classpath. You can do this via command line arguments, but the simplest way is to add the jars to the %JAVA_HOME%/jre/lib/ext directory.

There is a java forum here at GameDev, and several forums at javagaming.org. You can also find forums at Sun''s website as well as javalobby.org.
Kingstone426
Kingstone426
Thanks a lot for the reply Aldacron and sorry for posting in the wrong forum.
It works great now!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.