-
I see such exception:
when I tried to run app with jar-in-jar-loader created by Eclipse 2023-12 (using Oracle jdk21). Content of MANIFEST.FM file is:
All expected files (including jars) are in places in main jar file. Launching command is |
Beta Was this translation helpful? Give feedback.
Replies: 9 comments 1 reply
-
Thank you very much for the report. We'll look into that. To add some context to other contributors, this was motivated by your question on SO. The failure of the |
Beta Was this translation helpful? Give feedback.
-
@ppkarwasz |
Beta Was this translation helpful? Give feedback.
-
I can not reproduce the issue. I created a I think Eclipse might be messing with the
whereas it should be:
|
Beta Was this translation helpful? Give feedback.
-
@ppkarwasz <!--this file was created by Eclipse Runnable JAR Export Wizard-->
<!--ANT 1.7 is required -->
<!--creation of basic scolog.jar-->
<target name="build of JAR" depends="preparation">
<jar destfile="${OUT_DIR}\${APP_NAME}.jar">
<manifest>
<attribute name="Main-Class" value="org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader" />
<attribute name="Rsrc-Main-Class" value="rmdev.scolog.SCoLog" />
<attribute name="Class-Path" value="." />
<attribute name="Rsrc-Class-Path" value="./ lib/log4j/log4j-api-3.0.-beta1.jar lib/log4j/log4j-core-3.0.-beta1.jar lib/log4j/log4j-plugins-3.0.-beta1.jar lib/jdatepicker-1.3.4.jar" />
<!--<attribute name="Rsrc-Class-Path" value="./ lib/log4j/log4j-api-2.22.1.jar lib/log4j/log4j-core-2.22.1.jar lib/jdatepicker-1.3.4.jar" />-->
</manifest>
<zipfileset src="jar-in-jar-loader.zip" />
<!--<zipfileset dir="${WORKSPACE_DIR}\${PROJECT_NAME}\production\additional_input\data" includes="**/*.*" prefix="data" />-->
<zipfileset dir="${WORKSPACE_DIR}\${PROJECT_NAME}\lib" includes="**/*.jar" prefix="lib" />
<fileset dir="../bin" />
</jar>
</target> And this is structure of my libs in project: And this is eclipse 'configure build path': Simply speaking I forced all libs to be in /lib in uberjar to avioid mess caused by presence of jars in root of uberjar. |
Beta Was this translation helpful? Give feedback.
-
Just for clarification, earlier I used this pattern with uberjar and I had proper results. |
Beta Was this translation helpful? Give feedback.
-
This is my jar-in-jar-loader.zip |
Beta Was this translation helpful? Give feedback.
-
You have a typo in your script: <attribute name="Rsrc-Class-Path" value="./ lib/log4j/log4j-api-3.0.-beta1.jar lib/log4j/log4j-core-3.0.-beta1.jar lib/log4j/log4j-plugins-3.0.-beta1.jar lib/jdatepicker-1.3.4.jar" /> should be: <attribute name="Rsrc-Class-Path" value="./ lib/log4j/log4j-api-3.0.0-beta1.jar lib/log4j/log4j-core-3.0.0-beta1.jar lib/log4j/log4j-plugins-3.0.0-beta1.jar lib/jdatepicker-1.3.4.jar" /> |
Beta Was this translation helpful? Give feedback.
-
FACEPALM Anyway we can state that for jar-in-jar from newest eclipse everything works as expected. I'm sorry for bothering you wiht my blindness and thank you for your time. |
Beta Was this translation helpful? Give feedback.
-
These kind of typos are the most time consuming and frustrating. My Ant is rusty, but there is a way to generate the Something like this should work: <property name="libDir" location="${basedir}/lib" />
<zipfileset id="classpath" dir="${libDir}" includes="**/*.jar" prefix="lib" />
<pathconvert property="classpath.list" refid="classpath" dirsep="/" pathsep=" ">
<map from="${libDir}" to="lib"/>
</pathconvert>
<target name="build of JAR" depends="preparation">
<jar destfile="${OUT_DIR}\${APP_NAME}.jar">
<manifest>
<attribute name="Main-Class" value="org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader" />
<attribute name="Rsrc-Main-Class" value="rmdev.scolog.SCoLog" />
<attribute name="Class-Path" value="." />
<attribute name="Rsrc-Class-Path" value="./ ${classpath.list}" />
</manifest>
<zipfileset src="jar-in-jar-loader.zip" />
<zipfileset refid="classpath" />
<fileset dir="../bin" />
</jar>
</target> |
Beta Was this translation helpful? Give feedback.
@riwarek,
You have a typo in your script:
should be: