I want to make one jar file (A.jar) with my class file and the other jar files (B.jar & C.jar) I need to run. I am writing a test driver which uses the Jakarta Common Http Client, for which I need two jar files (B.jar & C.jar). My code runs fine if I have these Http Client jar files (B.jar & C.jar) somewhere and use set the classpath correctly. But I would like to place these two jar files (B.jar & C.jar) into the jar file I am making (A.jar), so that installing all this will be simpler. I am using Ant and am able to create the jar file (A.jar) with the class file and Http Client jars (B.jar & C.jar). The problem comes when I try and run. I am creating the MANIFEST.MF file within my Ant jar task and setting my classpath there:
But when I run this I get:
Any ideas? [ March 18, 2004: Message edited by: William Barnes ] [ March 18, 2004: Message edited by: William Barnes ]
Please ignore post, I have no idea what I am talking about.
java.net.MalformedURLException: unknown protocol: commons-httpclient.jar That's because you have an ill-formed Class-Path in your manifest file. They aren't supposed to be colon-separated. But yes, you cannot use jars-within-jars. The Class-Path entry will look in the same directory for those jars, not for those jars inside this one.
I do something similar in my project by extracting the other .jars during he Ant build then jarring everything up into one .jar. Here is the relevant section of my Ant build. In it, I extract 4 .jar files and bundle my classes wit htheir contents:
Ok, so I go here: link and most of the legal stuff is talking about me changing the Jakarta code - which I am not doing. I am just using it. Finding the legal stuff which I think is talking about me the following needs to be included:
Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Where exactly I am suppose to include this isn't clear to me. How about if I create a README and put that into the jar? I don't see any legal language which said I couldn't use the class files outside of the jar. I guess I don't see how putting the class files into my jar is that much different than using their jar files. I am not trying to hide anything. If you look in the resulting jar it would have entries like this:
I am just trying to understand this. I don't want to do anything to break the license.
Joined: Sep 29, 2003
Depends on the license, but, in my case, it does NOT violate the licenses. Some licenses allow you to distribute/use the binary code in your own apps as long as you include their license with your app. Your mileage may vary. brian
William, it is all stated in section 4 of the license
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
You are allowed to modified and redistribute the code as long as you create a notice text file which specifies the modifications made and the orginal license agreement. Regards Nigel