Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to make in Eclipse SAR archive with jar libraries inside?

 
Witold Marshal
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to make SAR MBean with Eclipse. I take a "new SAR Project" in "New" option. The project is created but I don't know how to enclose additional jars that will get exported togerther with the whole SAR archive when I export it.
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you try adding the JARs to the project's Java Build Path (on the Libraries tab)?
 
Witold Marshal
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes of course. But it doesn't work. They are treated as normal libraries for JAR and during export they are not being enclosed to the SAR.
 
Tim Holloway
Saloon Keeper
Posts: 18303
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Eclipse isn't really equipped to do complex builds. It leaves that job for Maven and Ant.

Although I'm not really sure that even if it did do what you want that it would give you what you want. Which is to say that I don't think that the embedded JARs will be accessible from the SAR's classpath. Without special classloaders, jars inside of jars normally aren't.
 
Witold Marshal
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have seen a few examples of such SARs with JAR's inside on web without classloader. Even Hibernate documentation mention about such project.

I can do it with Winrar but I was expecting that Eclipse has this capability.
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have to agree with Tim. Eclipse is great as an editor. But when it comes to building or packaging, I use Ant or Maven. I have less aggravation that way.
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic