File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes IDEs, Version Control and other tools and the fly likes How to make in Eclipse SAR archive with jar libraries inside? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "How to make in Eclipse SAR archive with jar libraries inside? " Watch "How to make in Eclipse SAR archive with jar libraries inside? " New topic
Author

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

Witold Marshal
Ranch Hand

Joined: Feb 05, 2012
Posts: 48
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

Joined: May 14, 2008
Posts: 5823
    
    7

Did you try adding the JARs to the project's Java Build Path (on the Libraries tab)?


JBoss In Action
Witold Marshal
Ranch Hand

Joined: Feb 05, 2012
Posts: 48
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

Joined: Jun 25, 2001
Posts: 16012
    
  19

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
Witold Marshal
Ranch Hand

Joined: Feb 05, 2012
Posts: 48
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

Joined: May 14, 2008
Posts: 5823
    
    7

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to make in Eclipse SAR archive with jar libraries inside?