How to change startup icon image of a . jar?

Asked

Viewed 382 times

3

For example, exchange that cup of coffee for another icon.

  • 3

    Unlike executable files, common files like . jar has no icon of its own (the same goes for images, text documents and everything else that is associated with another application - even those that have thumbnails of files are handled by an extension of the OS). What shows the icon is the operating system, depending on the file association. In Windows this stays in the registry, and is usually linked when installing an application that "assumes" that extension, or when you do an "open with..." and choose a program definitively.

  • 1

    From a . jar is just not possible, or you exchange all . jars or none. One option is to create an executable that initializes yours. jar, or create a shortcut for it.

  • There is this software that converts . jar to . exe and you can set an image to the generated file. http://jsmooth.sourceforge.net/ , I don’t give an example because I don’t work with java, but here’s the tip.

  • 2

    Behold that my answer. There’s a hint of how to create a custom executable with icon and everything :)

  • 1

    You have an option called icon, just pass the path of some.icon file to it. -> https://a.fsdn.com/con/app/proj/launch4j/screenshots/basicSettings.PNG/1

  • @diegofm the application says output file is empty. How to proceed?

  • 1

    See print, all fields there should be informed. output is the path of the executable to be created, click on the tablet.

  • 1

    @Guilhermepassos https://i.stack.Imgur.com/hGATu.jpg

  • @diegofm appears a message saying: Specify minimum JRE bersion and/or bundled JRE path. How to proceed?

  • 1

    Do you want the application to perform at least on which version of Java Virtual Machine(jre) ? This is for compatibility purposes. For example, if you use Java 8 features, you need to have Java 8 as the minimum version, otherwise it won’t work.

  • 1

    @Guilhermepassos clicks on the JRE tab, has a field called min JRE.

  • 1

    Which version of the JRE you will define as minimum?

  • @diegofm 1.8.0_121, this one

  • 1

    @Guilhermesteps after filling all the fields of the first tab and inserting this minimum version in the field I showed, click on the gear symbol at the top of the screen. Launch will ask you to save an xml, which is the configuration you just set in it. After that, your app.exe will be in the location you reported on output

  • 1

    @Guilhermepassos if you don’t pass the imagem.ico will not assign icon. It cannot be png or jpg, it is required to be .ico. And if it is a jar executed in text mode, it is also wasting time, it will not work if it is not executed in command line.

  • @diegofm the first icon problem, you just solved

  • @diegofm now, how so executed in text mode? What is the difference of command line

  • 1

    @Text mode steps is when it runs in a console window of the IDE, fully text. If you don’t have graphical interface, it’s silly to create exe.

  • @diegofm, I just formatted the image for ico and solved everything, now it is working perfectly. Thank you very much for your help, and above all for your patience!

  • @Guilhermepassos without any problems. :)

Show 15 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.