Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Export to runnable jar is missing projects(The projects which were added to the build parth are not in the exported jar )
Export to runnable jar is missing projects [message #1848369] Tue, 30 November 2021 01:02 Go to next message
John Sijm is currently offline John SijmFriend
Messages: 2
Registered: November 2021
Junior Member
Hello,
I just using eclopse Version: 2021-09 (4.21.0) Build id: 20210910-1417
I want to export my project as a runnable jar. It is a JPA project.
My project uses also other projects and these are added in the Projects tab in the Build Path and checked (if necessary in the Order and Export tab also in the Build Path).
When I exported this project I got a classNotFoundException.
And after investigation I saw that when I opened the jar with 7Zip that the projects ar missing. I tried all the three options which you can choose during the export (Extract, Package , Copy) and all runnable jars give the same results.
In a earlier version of Eclipse f.i. 2020-09 it worked.
But lately my computer crashed and I had to reinstall everything and also eclipse. Maybe this had impact on the way Export works.

I found out that if I create a new JAVA Project the export works but as soon as I converted it to a MAVEN project it doesn't work anymore the other Projects from the build path are not in the jar anymore .

I hope someone can give me some tips to get it work again.
Thanks,
John

[Updated on: Tue, 30 November 2021 02:31]

Report message to a moderator

Re: Export to runnable jar is missing projects [message #1856375 is a reply to message #1848369] Wed, 07 December 2022 18:53 Go to previous messageGo to next message
Jay Chapman is currently offline Jay ChapmanFriend
Messages: 1
Registered: December 2022
Junior Member
:It's a bit late for this user, but if anyone else has this problem, here's something to check.

In addition to adding the Project to the Java Build Path in the Project Properties, be sure to add the Project to the Classpath Entries under Dependencies in the Run Configuration you are using when exporting as a runnable jar.
Re: Export to runnable jar is missing projects [message #1856419 is a reply to message #1856375] Thu, 08 December 2022 23:53 Go to previous message
Joseph Janos is currently offline Joseph JanosFriend
Messages: 2
Registered: February 2015
Junior Member
Thank you very much for posting this!

This solved my problem!

Joseph

(I don't know if this is a feature or a bug, but I **would** think that if I want to export a 'runnable Jar', well, then I want to export a runnable jar.)

My scenario: I develop in one environment (happens to be a local machine, with Eclipse) and I go live on AWS, on a small, headless machine. I installed there Java (yes, I know that in order to run a jar, I need Java) but I didn't install any of the referenced libraries. Why would I if Eclipse (on better days) can do it for me.
Previous Topic:Cannot invoke "org.eclipse.jdt.launching.IVMInstall.getLibraryLocations()"
Next Topic:How to compile and package the eclipse compiler?
Goto Forum:
  


Current Time: Tue Apr 23 08:47:10 GMT 2024

Powered by FUDForum. Page generated in 0.03606 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top