1

I have created a java project, and I have exported it to my desktop.

Is there a way of converting that .jar file on my desktop, to a Unix executable file?

6
  • 1
    Java is available on many platforms - simply install java on the desired platform and java -jar myjar.jar. Commented Mar 29, 2020 at 18:14
  • Thanks for your reply. I already know that terminal command, but I would like to know how to convert that .jar file, to a Unix executable file. Commented Mar 29, 2020 at 18:17
  • Perhaps explaining a bit more on why? in your post might elicit more responses - that's all I can add - good luck. Commented Mar 29, 2020 at 18:19
  • If you use Java 14 check out jpackage. Commented Mar 29, 2020 at 18:28
  • What properties do you need? It is trivially simple to write a launcher script. Commented Mar 29, 2020 at 18:39

1 Answer 1

1

You can create a launch file (shortcut). You need to create a file with text:

#!/bin/sh java -jar myProject.jar 

and make it executable:

chmod + x ./shortcutfile 

OR

Right click on jar-file. Select "Open With Other Application" and choose "Runtime Environment".

Sign up to request clarification or add additional context in comments.

1 Comment

I will try that. Thanks. I don't seem to have the Runtime Enrionment option for some reason. Any idea why not?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.