Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » problem in user defined order of jar files during exporting(exporting with runnable jar file)
problem in user defined order of jar files during exporting [message #634565] Fri, 22 October 2010 09:16 Go to next message
ven chowdaryFriend
Messages: 7
Registered: October 2010
Location: Munich
Junior Member
Dear All,
I am having problem in handling the order of jar files while exporting the eclipse project to runnable jar file.

I have FOP and SAXON external jar files. I wanted saxon.jar to be before FOP.jar. i have set this order in my classpath definition of eclipse. when i export the project to runnable jar file then the order of the jar files are changing and i am having problem in run time.

any suggestions please. Looking forward for your valuable reply.

Regards
Ven
Re: problem in user defined order of jar files during exporting [message #634607 is a reply to message #634565] Fri, 22 October 2010 12:32 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

You mean if eclipse generates the MANIFEST.MF for your jar, it generates
the Class-Path: header in the wrong order?

If that's the case 1) open a bug against Eclipse JDT/UI -
https://bugs.eclipse.org/bugs and 2) a workaround is for you to supply
the MANIFEST.MF yourself.

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Platform_Expression_Framework
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Re: problem in user defined order of jar files during exporting [message #635044 is a reply to message #634607] Mon, 25 October 2010 14:17 Go to previous messageGo to next message
ven chowdaryFriend
Messages: 7
Registered: October 2010
Location: Munich
Junior Member
Hi Paul,
If i generate Runnable Jar file using Eclipse then there is not Manifest file generated. In this case the order of the jar files are in alphabetical order.

In the case when i generate jar file only then it asks me where to generate the manifest file and i selected the placeholder with the name of the manifest but the manifest does not have any classpath information.

Could you please help in guiding me how to generate normal jar file with the classpath order jar files in eclipse and the steps i need to take care.
because when i try to generate the output, what i got is not related to what i want. The order of the jar files in alphabetical order.

Thank you in advance.

Ven
Re: problem in user defined order of jar files during exporting [message #635097 is a reply to message #635044] Mon, 25 October 2010 15:48 Go to previous messageGo to next message
ven chowdaryFriend
Messages: 7
Registered: October 2010
Location: Munich
Junior Member
Below is my manifest file

Manifest-Version: 1.0
Class-Path: .
../TACommon/libs/avalon-framework-4.2.0.jar
../TACommon/libs/batik-all-1.7.jar
../TACommon/libs/saxon9he.jar
../TACommon/libs/fop.jar
../TACommon/libs/jdom-1.1.jar
../TACommon/libs/junit-4.8.2.jar
../TACommon/libs/serializer.jar
../TACommon/libs/xsltc.jar
../TACommon/libs/xmlgraphics-commons-1.4.jar
../TACommon/libs/xstream-1.3.1.jar
../TACommon/libs/xstream-benchmark-1.3.1.jar
../TACommon/libs/commons-io-1.4.jar
Main-Class: com.ssc.ta.dgc.SampleTest


i could not find the library jar files while running after jar file creation, these library files are mentioned in the manifest. But these library jar files are in TACommon folder outside the project .
Re: problem in user defined order of jar files during exporting [message #635121 is a reply to message #635097] Mon, 25 October 2010 16:46 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

ven chowdary wrote:
> i could not find the library jar files while running after jar file
> creation, these library files are mentioned in the manifest. But these
> library jar files are in TACommon folder outside the project .

Supply your own manifest, then it will do what you want.

See http://download.oracle.com/javase/tutorial/deployment/jar/ for
working with MANIFESTs and Class-Path.

PW



--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Platform_Expression_Framework
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Re: problem in user defined order of jar files during exporting [message #635147 is a reply to message #635121] Mon, 25 October 2010 18:35 Go to previous messageGo to next message
ven chowdaryFriend
Messages: 7
Registered: October 2010
Location: Munich
Junior Member
Dear paul,
The Manifest mentioned in the above posting is the supplied one.
Basically the question on my side is . How to access the libraries that are out side the project folder.

example in my case . I have project A and project B in eclipse. My building jar file of project B which uses project A and libraries which are in the libs folder of project A. Building of jar file on project B is successful , but when i run project B then it completes that the classes used from libraries in projects A are not found. When i open the project B jar file then i see the libraries are in the jar file.
Could you please help me . I tried all the possible ways which i can think off.

Regards
Ven
Re: problem in user defined order of jar files during exporting [message #635259 is a reply to message #635147] Tue, 26 October 2010 08:19 Go to previous messageGo to next message
ven chowdaryFriend
Messages: 7
Registered: October 2010
Location: Munich
Junior Member
Small corrections in the example given.

My building jar file of project B which uses project A and libraries which are in the libs folder of project A. Building of jar file on project B is successful , but when i run project B then it completes that the classes used from libraries in projects A are not found. When i open the project B jar file then i see the libraries are in the jar file.
Could you please help me . I tried all the possible ways which i can think off.


When exporting project B to jar file, i have fed the manually written manifest file as mentioned in the below posting. after exporting project B to jar file , i opened the jar file to check the contents of the jar file. In the project B jar file i can see all the jar files that i have been using from the project A folder structure. But when i run project B it complaints that it could not find the classes from the jar files that are in the project A.
Here is sample exception
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/fop/apps/FopFactory

This exception arised because it could not find the FOP.jar which is mentioned in classpath of project B and the jar file is inside project A folder structure.

Re: problem in user defined order of jar files during exporting [message #635341 is a reply to message #635259] Tue, 26 October 2010 13:40 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

And how are you running project B? What's the command line?

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Platform_Expression_Framework
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Re: problem in user defined order of jar files during exporting [message #635342 is a reply to message #635341] Tue, 26 October 2010 13:54 Go to previous messageGo to next message
ven chowdaryFriend
Messages: 7
Registered: October 2010
Location: Munich
Junior Member
java -jar B.jar
the main class of B project is Main-Class: com.ssc.ta.dgc.SampleTest
as mentioned in manifest file.
Re: problem in user defined order of jar files during exporting [message #635576 is a reply to message #635342] Wed, 27 October 2010 11:50 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

ven chowdary wrote:
> java -jar B.jar

Then if you have Class-Path: ../lib/lib1.jar it expects to find that jar
relative to B.jar

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Platform_Expression_Framework
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Re: problem in user defined order of jar files during exporting [message #635854 is a reply to message #635576] Thu, 28 October 2010 11:29 Go to previous message
ven chowdaryFriend
Messages: 7
Registered: October 2010
Location: Munich
Junior Member
Dear paul

Thank you for your support.
I could find the problem on my side.
The problem is " Space after the jar file". I did not leave a space after the jar file text information but i left in front. some times silly problems create hell

../TACommon/libs/avalon-framework-4.2.0.jar<SPACE>
../TACommon/libs/batik-all-1.7.jar<SPACE>
../TACommon/libs/saxon9he.jar<SPACE>
../TACommon/libs/fop.jar<SPACE>
../TACommon/libs/jdom-1.1.jar<SPACE>
../TACommon/libs/junit-4.8.2.jar<SPACE>
../TACommon/libs/serializer.jar<SPACE>
Previous Topic:How to contribute configurations programmatically
Next Topic:Removing updatesite fix
Goto Forum:
  


Current Time: Fri Dec 19 01:32:06 GMT 2014

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

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