سؤال

I'm sorry if this question has been already asked but I did not found it on StackOverflow.

Here is my problem, I have a JAVA project, and I create an executable .jar file with it and I want to know if it is possible to create a .bat file or something to automatically create a shortcut on the user's Desktop and how to do that.

I also want to know if it is possible to automatically place an Icon on my executable .jar and how to do it.

I've already searched the net to find solutions to my problem and people says things like it depends of the OS and create a .exe to do it, but I d'ont want to create a .exe file with my .jar executable file. And I also did not totally understand what they were talking about...

هل كانت مفيدة؟

المحلول

You can create a StartJar.bat file in the Desktop itself. Then edit that .bat file and add the following:

@echo OFF cd <path to the executable jar> java -jar yourJar.jar

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top