Embed JAR - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

kryszczyn
Posts: 3
Joined: Mon Jan 17, 2011 12:03 am

Embed JAR

Hi,

AdvancedInstaller version 7.7 - Polish.

I have problems with embeding jar into project. I've written large gui application
in netbeans. I used package-for-store build to include all libraries in 1 jar file.
This jar has everything in it. I've created installer and selected've Embeded JAR to my
"large file" :).

After installation and execution a fallowing message appears (in polish):

Klasa główna (Main Class) nie została określona w pliku INI.
In english (my translation): Main Class has no representation in INI file.


I have in jar file MANIFEST.MF (uppercase letters) with Main Class in it.
I've selected MainClass in JRE Setting in JavaProject tab in AdvancedInstaller.
I've double checked INF file - "Main Class" is there.

I've tried to create several advanced installer projects with different
setting to resolve this problem. No results.

I've checked FAQ and Howtos no answare there.

Everything works when this "largefile.jar" file is added to "Files and Folders"
and selected in Classpath (without EmbededJAR selected).
But to "virtualy" secure my jar I want it to be embeded in exe file.

My package for store ant code:

Code: Select all

<target name="package-for-store" depends="jar">
        <property name="store.jar.name" value="LargeFile"/>


        <!-- don't edit below this line -->

        <property name="store.dir" value="store"/>
        <property name="store.jar" value="${store.dir}/${store.jar.name}.jar"/>

        <echo message="Packaging ${application.title} into a single JAR at ${store.jar}"/>

        <delete dir="${store.dir}"/>
        <mkdir dir="${store.dir}"/>

        <jar destfile="${store.dir}/temp_final.jar" filesetmanifest="skip">
            <zipgroupfileset dir="dist" includes="*.jar"/>
            <zipgroupfileset dir="dist/lib" includes="*.jar"/>

            <manifest>
                <attribute name="Main-Class" value="${main.class}"/>
            </manifest>
        </jar>

        <zip destfile="${store.jar}">
            <zipfileset src="${store.dir}/temp_final.jar"
            excludes="META-INF/*.SF, META-INF/*.DSA, META-INF/*.RSA"/>
        </zip>

        <delete file="${store.dir}/temp_final.jar"/>
</target>

mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Embed JAR

Hello and welcome to the Advanced Installer Forums,

Do you, by any chance, have a digital signature for the package and for the java product?

If this is the case you can fix the error in two ways:
1. Add the JAR in the Files and Folders page and to the Classpath from the Java Products page( as you already observed ).
2. Remove the digital signature of the launcher from its file properties in the Files and Folders page.

This is happening because the embedded JAR functionality is not compatible with digitally signing the same java product.

Regards,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
kryszczyn
Posts: 3
Joined: Mon Jan 17, 2011 12:03 am

Re: Embed JAR

mihai.petcu wrote:Hello and welcome to the Advanced Installer Forums,
:) thx
mihai.petcu wrote: Do you, by any chance, have a digital signature for the package and for the java product?
I don't have digital signature. I can create one using this tutorial:
http://download.oracle.com/javase/tutor ... ensig.html
but...
mihai.petcu wrote: If this is the case you can fix the error in two ways:
1. Add the JAR in the Files and Folders page and to the Classpath from the Java Products page( as you already observed ).
2. Remove the digital signature of the launcher from its file properties in the Files and Folders page.
I did these steps. First one - no change. Second one - no change. Error msg is always the same.
I even did both :) but no change.
mihai.petcu wrote: This is happening because the embedded JAR functionality is not compatible with digitally signing the same java product.
Maybe but the error remains.

Cheers,
Krystian
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Embed JAR

Hi Krystian,

Please send us all your source files and the .AIP (project) to support at advancedinstaller dot com so we can reproduce and investigate the issue.

Best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
kryszczyn
Posts: 3
Joined: Mon Jan 17, 2011 12:03 am

Re: Embed JAR

mihai.petcu wrote: Please send us all your source files and the .AIP (project) to support at advancedinstaller dot com so we can reproduce and investigate the issue.
I can't send you my source code. It's out of the question.
I've used largefile as methapore to low the presure, but in fact
my largefile is my program I sell and distribute.

I can send only aip. file

Regards
Krystian
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Embed JAR

Hello Krystian,

By the source files I meant the JAR that is causing the problem as well as your AIP.
If you are concerned about confidentiality, please isolate and reproduce the behavior in another test project and send that to support at advancedinstaller dot com for us to investigate.

Regards,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”