Eclipse: include source code when exporting as executable jar

I understand how to include other necessary libraries or external resources when creating the .jar executable in eclipse, but what I don't see is also the ability to include src.java files as well.

How could I do this?

+6
source share
3 answers

In the Export --> Jar File dialog box, you can include source files and resources.

enter image description here

To make runnable a standard Jar File, you only need to add / enable the appropriate MANIFEST.MF yourself ...

+7
source

Export to Runnable jar. Open Runnable Jar with WinRAR. Click the "Add" button, select the src.zip file.

+2
source

I know this answer is very late, but for those who still read this:

Eclipse has this option. You probably just didn't notice it. I did not check with which version, Eclipse Luna is for sure.

  • Export --> Jar File
  • then do not click Finish , but click Next .
  • You have more options.
  • You may have to click Next twice to go to the Main Class selection.
+1
source

Source: https://habr.com/ru/post/925713/


All Articles