This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Jar question Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "Jar question" Watch "Jar question" New topic
Author

Jar question

Rus Corina
Ranch Hand

Joined: Jul 08, 2011
Posts: 90
Hello. I have a question. I currently have a project that contains some buttons, to which i added some icons. The problem appears when i make a jar out of my project. The jar file does not take the icons. Does anyonje know what should I do in order to have the icons in the jar?
(I saved the icons in the folder of my project)
Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

Have you look at the Java tutorials Jar section?


"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
Rus Corina
Ranch Hand

Joined: Jul 08, 2011
Posts: 90
I know this will sount very stupid, but, here it goes: yes, i've seen it, but i have absolutely no idea where to run this command:
jar cvf TicTacToe.jar TicTacToe.class audio images
or any other commands like this. So if you could help me, i would be really grateful. I only know how to make a jar in netbeans or eclipse.
Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

On windows: press windowskey + r, type cmd, ok. Now a black screen will open. This is a console. With the command "cd <dirname>" you can go into a directory, with cd .. you can move up a directory. With the command "dir" you can view the directory content.

Now browse to your project location and then you can use the jar command. If you get the notification that the jar command is unknown then you'll need to add the locationWhereYouInstalledJava/bin to your PATH environment variable.
Rus Corina
Ranch Hand

Joined: Jul 08, 2011
Posts: 90
@Wouter Oet
Thank you very much
 
I agree. Here's the link: http://jrebel.com/download
 
subject: Jar question
 
Similar Threads
WSAD and the Jars (sounds like a good band)
problems with runme.jar referencing resources
jar runs on desktop but not laptop
Loading images in executable jar
Where are the java (standard) icons