Generate multiple APK's with same code base using ANT - java

I am trying to generate multiple apk with same code using ANT and have followed many posts to get it done. But i am unable to build the project successfully.
Let me start with my first problem. I have a main project which has two library projects, something like
Main Project ---> Library Project(isLibrary) ---> Google Play Services (isLibrary)
When i am trying to update those projects, each and every time getting a message like
It seems that there are sub-projects. If you want to update them
please use the --subprojects parameter.
So, from the above message it looks like am failing at early step of the build process.
Then i have added the following snippet prior to
<target
name="-package-resources" >
<!-- only package resources if *not* a library project -->
<echo message="Current Package name: ${app.custompackagename}" />
<do-only-if-not-library elseText="Library project: do not package resources..." >
<aapt
androidjar="${project.target.android.jar}"
apkfolder="${out.absolute.dir}"
assets="${asset.absolute.dir}"
buildType="${build.target}"
command="package"
debug="${build.is.packaging.debug}"
executable="${aapt}"
ignoreAssets="${aapt.ignore.assets}"
libraryPackagesRefid="project.library.packages"
libraryRFileRefid="project.library.bin.r.file.path"
libraryResFolderPathRefid="project.library.res.folder.path"
manifest="${out.manifest.abs.file}"
manifestpackage="${app.custompackagename}"
nocrunch="${build.packaging.nocrunch}"
previousBuildType="${build.last.target}"
resourcefilename="${resource.package.file.name}"
resourcefilter="${aapt.resource.filter}"
versioncode="${version.code}"
versionname="${version.name}" >
<res path="${out.res.absolute.dir}" />
<res path="${resource.absolute.dir}" />
<!-- <nocompress /> forces no compression on any files in assets or res/raw -->
<!-- <nocompress extension="xml" /> forces no compression on specific file extensions in assets and res/raw -->
</aapt>
</do-only-if-not-library>
</target>
then i have executed the following command from command line
ant debug -Dpackage.manifest.name=com.example.test
and here are my logs
BUILD FAILED
D:\Vijay\Android\android-sdk_r06-windows\android-sdk_r06-windows\android-sdk-win
dows\tools\ant\build.xml:571: Failed to resolve library path: D:\Vijay\Android\G
itHub\project\library

Related

libphonenumber shows a NoClassDefFoundError during the attempt to get the object instance

We are trying to get the libphonenumber to run in our java project.
The java project is running as a service on one of our servers.
On our local machines, we are using the following shell commands to include the libraries (please ignore the version numbers):
export ANT_HOME="C:\DEV\apache-ant-1.9.16"
export JAVA_HOME="C:\Program Files\Java\jdk-15.0.2"
export MAVEN_HOME="C:\DEV\apache-maven-3.8.6"
export PATH=${PATH}:${JAVA_HOME}/bin:${ANT_HOME}/bin:${MAVEN_HOME}/bin
export MB_API_HOME="C:\DEV\java-rest-api\api\target"
After we run the "ant" command, we move the result file (jar) on our server in the respective folder.
These are the 3 files that are needed for the library:
We have copied them on the server, in the respective lib folder.
Everything runs fine until the following error shows up:
java.lang.NoClassDefFoundError: com/google/i18n/phonenumbers/PhoneNumberUtil
This happens when it comes to the following line:
PhoneNumberUtil util = PhoneNumberUtil.getInstance();
We have found the following code on this website (https://www.baeldung.com/java-libphonenumber), where it is explained that this has to go to a pom-xml file:
<dependency>
<groupId>com.googlecode.libphonenumber</groupId>
<artifactId>libphonenumber</artifactId>
<version>8.12.10</version>
</dependency>
We have no clue which pom.xml they are writing about. These are the files that are being found by IntelliJ:
IntelliJ has no problems finding the classes and their methods when we type in the code window.
What else do we have to do and consider to get it to run on the server?
Thanks in advance.
Edit 1 of ?: As g00se suggested, we already have the class path mentioned in the build.xml, which looks like this:
I had the idea of removing the libphonenumber.jar from the lib folder on the server itself to see if we receive a different error. But it is still the same NoClassDefFoundError. It is as if the result file of ant has no clue about libphonenumber at all!
Edit 2 of ?:
I have experimented with this library on my private computer.
If I click on the run icon (1), it seems to work, as seen in (2).
However, going to the folder with the Main class (3) and running java Main, leads to the same error:
But then, I just copied the classes into the folder where the Main is, and the error changed:
Here is the snippet in the build.xml of my private project:
<target name="compile" depends="init"
description="compile the source">
<!-- Compile the Java code from ${src} into ${build} -->
<javac srcdir="${src}" destdir="${build}">
<classpath>
<pathelement path="jars/libphonenumber.jar"/>
</classpath>
</javac>
</target>
I guess I am missing the right approach here, do I?
Edit 3 of ?: I created a repository of my private/test project.
Here it is: https://github.com/3rc4n/libphonenumberexperiment

error while cleaning and building javafx app in netbeans, XML document structures must start and end within the same entity

I'm new to xml, and trying to deploy my javafx program, getting to run and clean I've got the following error, and couldn't find any answer regarding the solution thereof, so would appreciate if you helped me:
F:\IT\PROGRAMMING\LJPROJECTS\MyShutDownTheCompProgram\build.xml:67: XML document structures must start and end within the same entity.
The xml code goes as follows:
<?xml version="1.0" encoding="UTF-8"?><!-- You may freely edit this file. See commented blocks below for --><!-- some examples of how to customize the build. --><!-- (If you delete it and reopen the project it will be recreated.) --><!-- By default, only the Clean and Build commands use this build script. --><project name="MyShutDownTheCompProgram" default="default" basedir="." xmlns:fx="javafx:com.sun.javafx.tools.ant">
<description>Builds, tests, and runs the project MyShutDownTheCompProgram.</description>
<import file="nbproject/build-impl.xml"/>
<!--
There exist several targets which are by default empty and which can be
used for execution of your tasks. These targets are usually executed
before and after some main targets. Those of them relevant for JavaFX project are:
-pre-init: called before initialization of project properties
-post-init: called after initialization of project properties
-pre-compile: called before javac compilation
-post-compile: called after javac compilation
-pre-compile-test: called before javac compilation of JUnit tests
-post-compile-test: called after javac compilation of JUnit tests
-pre-jfx-jar: called before FX SDK specific <fx:jar> task
-post-jfx-jar: called after FX SDK specific <fx:jar> task
-pre-jfx-deploy: called before FX SDK specific <fx:deploy> task
-post-jfx-deploy: called after FX SDK specific <fx:deploy> task
-pre-jfx-native: called just after -pre-jfx-deploy if <fx:deploy> runs in native packaging mode
-post-jfx-native: called just after -post-jfx-deploy if <fx:deploy> runs in native packaging mode
-post-clean: called after cleaning build products
(Targets beginning with '-' are not intended to be called on their own.)
Example of inserting a HTML postprocessor after javaFX SDK deployment:
<target name="-post-jfx-deploy">
<basename property="jfx.deployment.base" file="${jfx.deployment.jar}" suffix=".jar"/>
<property name="jfx.deployment.html" location="${jfx.deployment.dir}${file.separator}${jfx.deployment.base}.html"/>
<custompostprocess>
<fileset dir="${jfx.deployment.html}"/>
</custompostprocess>
</target>
Example of calling an Ant task from JavaFX SDK. Note that access to JavaFX SDK Ant tasks must be
initialized; to ensure this is done add the dependence on -check-jfx-sdk-version target:
<target name="-post-jfx-jar" depends="-check-jfx-sdk-version">
<echo message="Calling jar task from JavaFX SDK"/>
<fx:jar ...>
...
</fx:jar>
</target>
For more details about JavaFX SDK Ant tasks go to
http://docs.oracle.com/javafx/2/deployment/jfxpub-deployment.htm
For list of available properties check the files
nbproject/build-impl.xml and nbproject/jfx-impl.xml.
-->
<target name="-post-jfx-deploy">
<fx:deploy width="${javafx.run.width}" height="${javafx.run.height}"
nativeBundles="all"
outdir="${basedir}/${dist.dir}" outfile="${application.title}">
<fx:application name="${application.title}"
mainClass="${javafx.main.class}"/>
<fx:resources>
<fx:fileset dir="${basedir}/${dist.dir}"
includes="*.jar"/>
</fx:resources>
<fx:info title="${application.title}"
vendor="${application.vendor}"/>
</fx:deploy>
</target>
You must have to end the tags you started before.
You have to use </project> at end of your XML file.
Open build.xml file from your Files tab. Usually there put two tags with the same name, and does the same job.The first one is <build> and the second is <defend> you should delete these extra two tags.

How to use HockeyApp SDK with Qt on Android

I am trying to integrate the HockeyApp Android SDK in its latest version 4.1.2 into our Qt Android app. I don't know a lot about Android development or Java in general - nor any Qt or HockeyApp internals.
There is some general official documentation on including third party Android (i.e. Java) libraries into a Qt project; however, it mentions a "Create AndroidManifest.xml button in the Deployment settings" which does not exist in the current Qt Creator 4.2.0 version, so I am unsure as to how outdated this documentation is or what parts possibly still apply.
HockeyApp documentation only covers "typical Android development" using Android Studio and their support is not supportive.
On a side note, integrating the HockeyApp iOS SDK took just a couple of hours and was mostly a matter of writing some Objective C bridge code.
Step 1: Add the SDK to the project
First approach
I tried to follow the above documentation and added the unzipped HockeySDK-Android-4.1.2 folder and a project.properties file with contents
android.library.reference.1=HockeySDK-Android-4.1.2/libs/
to a project folder; I also set ANDROID_PACKAGE_SOURCE_DIR in <my project>.pro to that project folder.
Problem: The androiddeployqt build step issues an error message (wrapped for readability)
Error: <path to build folder>/android-build/HockeySDK-Android-4.1.2/libs
is not a valid project (AndroidManifest.xml not found).
but continues anyway and finally fails with an error message (also wrapped for readability)
BUILD FAILED
/opt/Android/android-sdk-macosx/tools/ant/build.xml:573:
HockeySDK-Android-4.1.2/libs/ resolve to a path
with no project.properties file for project <path to build folder>/android-build
Running androiddeployqt with a --verbose switch adds significantly more output, but zero useful information.
Second approach
The downloaded HockeyApp Android SDK zip archive contains - besides some documentation - a file libs/HockeySDK-4.1.2.aar; from this response and this comment, I gather the AAR format is simply a zip archive that, among others, contains an AndroidManifest.xml file. I unzipped libs/HockeySDK-4.1.2.aar in place, then removed it; now the first error message in the build is gone.
Problem: The build fails with
BUILD FAILED
/opt/Android/android-sdk-macosx/tools/ant/build.xml:597:
The following error occurred while executing this line:
/opt/Android/android-sdk-macosx/tools/ant/build.xml:649:
The following error occurred while executing this line:
/opt/Android/android-sdk-macosx/tools/ant/build.xml:655:
<path to build folder>/android-build/HockeySDK-Android-4.1.2/libs/src does not exist.
Again, adding running --verbose to androiddeployqt adds nothing but noise. Looking into the build.xml locations mentioned doesn't help either.
Update:
I tried simply creating the missing folder from the error message; now the build fails as follows:
-dex:
[dex] input: <path to build folder>/android-build/bin/classes
[dex] input: <path to build folder>/android-build/HockeySDK-Android-4.1.2/libs/bin/classes.jar
[dex] input: <path to build folder>/android-build/libs/QtAndroid-bundled.jar
[dex] input: <path to build folder>/android-build/libs/QtAndroidBearer-bundled.jar
[dex] Pre-Dexing <path to build folder>/android-build/libs/QtAndroid-bundled.jar -> QtAndroid-bundled-a06280f40655c27b25038380a4d7f67c.jar
[dex] Pre-Dexing <path to build folder>/android-build/libs/QtAndroidBearer-bundled.jar -> QtAndroidBearer-bundled-a69fa323dbfa477411ea082423128813.jar
[dex] Converting compiled files and external libraries into <path to build folder>/android-build/bin/classes.dex...
[dx]
[dx] UNEXPECTED TOP-LEVEL EXCEPTION:
[dx] java.io.FileNotFoundException: <path to build folder>/android-build/HockeySDK-Android-4.1.2/libs/bin/classes.jar (No such file or directory)
[dx] at java.util.zip.ZipFile.open(Native Method)
[dx] at java.util.zip.ZipFile.<init>(ZipFile.java:219)
[dx] at java.util.zip.ZipFile.<init>(ZipFile.java:149)
[dx] at java.util.zip.ZipFile.<init>(ZipFile.java:163)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:244)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
[dx] at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
[dx] at com.android.dx.command.dexer.Main.processOne(Main.java:677)
[dx] at com.android.dx.command.dexer.Main.processAllFiles(Main.java:574)
[dx] at com.android.dx.command.dexer.Main.runMonoDex(Main.java:311)
[dx] at com.android.dx.command.dexer.Main.run(Main.java:277)
[dx] at com.android.dx.command.dexer.Main.main(Main.java:245)
[dx] at com.android.dx.command.Main.main(Main.java:106)
[dx] 1 error; aborting
BUILD FAILED
/opt/Android/android-sdk-macosx/tools/ant/build.xml:888: The following error occurred while executing this line:
/opt/Android/android-sdk-macosx/tools/ant/build.xml:890: The following error occurred while executing this line:
/opt/Android/android-sdk-macosx/tools/ant/build.xml:902: The following error occurred while executing this line:
/opt/Android/android-sdk-macosx/tools/ant/build.xml:283: null returned: 1
I obviously can not just make up some classes.jar file, but there is one single file with that name in <path to build folder>/android-build/HockeySDK-Android-4.1.2/libs, so I can create the missing bin folder and create a symlink in it to ../classes.jar.
The build now succeeds. Step 1 complete.
Step 2: Use the SDK in the project
Going back to the corresponding HockeyApp documentation, I gather I need to modify some code that looks similar to
public class YourActivity extends Activity
...
There is one single occurrence of such code in the project in <path to build folder>/android-build/src/org/qtproject/qt5/android/bindings/QtActivity.java:
public class QtActivity extends Activity
...
That file is copied there by the androiddeployqt tool (part of the Qt SDK) from its source folder inside the Qt SDK at $QTDIR/src/android/java, i.e. /opt/Qt/Qt_5.7.1/5.7/android_armv7/src/android on my machine.
Looking at the androiddeployqt source code, I see there is no way (e.g. by means of a command line parameter) to change the source folder these .java files are taken from, so it is not possible to provide my own set of files and have androiddeployqt copy that instead. Hence, in order to make this work, I must either extend / fix androiddeployqt functionality (sorry, I won't touch that code - yuck!) or modify the copied files at their source directly - which then obviously affects all projects build with that Qt SDK instance.
As a third approach, I could try patching the Java sources after androiddeployqt copied them to the build folder. Unfortunately, this not only makes the development and build workflow absurdly painful; it is also made entirely impossible by the androiddeployqt "one tool does everything" design fail (see below): There is no point in time in the build process where the Java sources exist in the project and the .apk package has not been built yet. I thought the androiddeployqt --no-build parameter would enable that:
--no-build: Do not build the package, it is useful to just install
a package previously built.
but "building" here refers to building the Qt / Java bridge code, not the actual app, so that parameter turns out to be pretty much useless for the task at hand; the build fails with this message - which by itself are a bug as the .apk file from the message does not exist and thus the Android package build was not successful:
Android package built successfully in 1.011 ms.
-- File: <path to build folder>/android-build//bin/QtApp-release-unsigned.apk
Sure, I could copy the sources elsewhere, patch and copy them manually to their final destination, but I think this is where I draw the line.
Actually, looking at the androiddeployqt source code is where the buck stops. Too much time has already been wasted trying to get dysfunctional tools to work:
I will not comment on how smart it is to write a build tool in C++ in the first place - in a single, ~3000 line main.cpp file
I will not comment on the practice of hardcoding the src/android/java path (and many other paths) in the androiddeployqt sources not once, but multiple times - instead of a const QString that at least prepares appropriate (i.e. external) tool configuration
I will not comment on how smart it is to violate the ~50 year old best practice of one tool, one purpose - and duplicate large amounts of functionality provided by Qt, Android or Java tools, such as building, signing, deploying, installing packages, etc.
However, the fact that this tool has made it past code review into a number of major Qt release is nothing short of frightening - and probably a good indicator that it's time to consider dropping Qt as a technology in general
While I am writing this, the Qt 5.8.0 installation keeps freezing, maxing out one CPU core - and has been doing so for the last ~12 hours. I rest my case.
My questions
has anyone had any success with Qt, Android and HockeyApp ?
does anyone have any hints / pointers / wild guesses as to what is wrong here ?
no further questions; I've seen enough
Step 3: Call SDK Java code from C++
(cancelled due to brickwall in step 2)
Answering my own question:
Using the HockeyApp SDK with Qt on Android is not possible without either patching Qt SDK tool source code or Qt SDK Java template source files.
In fact, from what I gather, it is not possible to use any third party libraries with Qt on Android if they require Java source code modification.
FWIW this is an AndroidManifest.xml I use for an app, no external library dependencies though. You could try adding+modifying this to get the deploy to work?
File structure:
/my-project-dir
├── android
│   ├── AndroidManifest.xml
│   └── res
│   └── drawable-mdpi
│   └── icon.png
├── my-project.pro
AndroidManifest.xml:
<?xml version="1.0"?>
<manifest package="my_package_name" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.0" android:versionCode="1" android:installLocation="auto">
<application android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="my_app_name" android:icon="#drawable/icon">
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|locale|fontScale|keyboard|keyboardHidden|navigation" android:name="org.qtproject.qt5.android.bindings.QtActivity" android:label="my_app_name" android:screenOrientation="unspecified" android:launchMode="singleTop">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<meta-data android:name="android.app.lib_name" android:value="-- %%INSERT_APP_LIB_NAME%% --"/>
<meta-data android:name="android.app.qt_sources_resource_id" android:resource="#array/qt_sources"/>
<meta-data android:name="android.app.repository" android:value="default"/>
<meta-data android:name="android.app.qt_libs_resource_id" android:resource="#array/qt_libs"/>
<meta-data android:name="android.app.bundled_libs_resource_id" android:resource="#array/bundled_libs"/>
<!-- Deploy Qt libs as part of package -->
<meta-data android:name="android.app.bundle_local_qt_libs" android:value="-- %%BUNDLE_LOCAL_QT_LIBS%% --"/>
<meta-data android:name="android.app.bundled_in_lib_resource_id" android:resource="#array/bundled_in_lib"/>
<meta-data android:name="android.app.bundled_in_assets_resource_id" android:resource="#array/bundled_in_assets"/>
<!-- Run with local libs -->
<meta-data android:name="android.app.use_local_qt_libs" android:value="-- %%USE_LOCAL_QT_LIBS%% --"/>
<meta-data android:name="android.app.libs_prefix" android:value="/data/local/tmp/qt/"/>
<meta-data android:name="android.app.load_local_libs" android:value="-- %%INSERT_LOCAL_LIBS%% --"/>
<meta-data android:name="android.app.load_local_jars" android:value="-- %%INSERT_LOCAL_JARS%% --"/>
<meta-data android:name="android.app.static_init_classes" android:value="-- %%INSERT_INIT_CLASSES%% --"/>
<!-- Messages maps -->
<meta-data android:value="#string/ministro_not_found_msg" android:name="android.app.ministro_not_found_msg"/>
<meta-data android:value="#string/ministro_needed_msg" android:name="android.app.ministro_needed_msg"/>
<meta-data android:value="#string/fatal_error_msg" android:name="android.app.fatal_error_msg"/>
<!-- Messages maps -->
<!-- Splash screen -->
<!--
<meta-data android:name="android.app.splash_screen_drawable" android:resource="#drawable/logo"/>
-->
<!-- Splash screen -->
</activity>
</application>
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="14"/>
<supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/>
<!-- The following comment will be replaced upon deployment with default permissions based on the dependencies of the application.
Remove the comment if you do not require these default permissions. -->
<!-- The following comment will be replaced upon deployment with default features based on the dependencies of the application.
Remove the comment if you do not require these default features. -->
<!-- %%INSERT_FEATURES -->
<!-- %%INSERT_PERMISSIONS -->
</manifest>

ZIP from Ant build fails to extract from Cornerstone LMS CSOD

I have an Ant build which ends with a simple ZIP task:
<target name="packModule" description="Pack the SCO ZIP">
<zip destfile="${deploy.dir}/sco_${module}_${lang}.zip" basedir="${deploy.dir}" />
</target>
This generates a ZIP file which gets deployed fine on many LMS, including SCORM Cloud. But on CSOD, it throws this error:
Error: Failed to unzip: Zip64 Extended information found but version is not valid
Right now, I have to manually unzip the package generated by Ant Build and rezip using 7-Zip to fix the issue. Please help me resolve this. Am on Windows7, using Ant version: apache-ant-1.9.6 and my JRE is jre1.8.0_45
Thanks to #VGR, zip64Mode="never" fixed the issue. I confirm it works fine on CSOD and doesn't require a manual unzip-zip routine. The final task looks like this:
<target name="packModule" description="Pack the SCO ZIP">
<zip zip64Mode="never" destfile="${deploy.dir}/sco_${module}_${lang}.zip" basedir="${deploy.dir}" />
</target>

ant -f build.xml run vs ant -f build jar

Can anyone please tell me what is the technical difference between,
1-
ant -f build.xml run
and
2-
ant -f build.xml jar
java -jar project.jar
I'm asking this because my application runs flawlessly with I run it with the number "1" command
BUT
Comes up with a whole lot of exceptions when is run as a jar file (Number 2 command set).
Any explanation for this??! I just want to know why the application responds differently to these two situations???!
Thanks
<?xml version="1.0" encoding="UTF-8"?>
<!-- You may freely edit this file. See commented blocks below for -->
<!-- some examples of how to customize the build. -->
<!-- (If you delete it and reopen the project it will be recreated.) -->
<!-- By default, only the Clean and Build commands use this build script. -->
<!-- Commands such as Run, Debug, and Test only use this build script if -->
<!-- the Compile on Save feature is turned off for the project. -->
<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
<!-- in the project's Project Properties dialog box.-->
<project name="LMB" default="default" basedir=".">
<description>Builds, tests, and runs the project LMB.</description>
<import file="nbproject/build-impl.xml"/>
<!--
There exist several targets which are by default empty and which can be
used for execution of your tasks. These targets are usually executed
before and after some main targets. They are:
-pre-init: called before initialization of project properties
-post-init: called after initialization of project properties
-pre-compile: called before javac compilation
-post-compile: called after javac compilation
-pre-compile-single: called before javac compilation of single file
-post-compile-single: called after javac compilation of single file
-pre-compile-test: called before javac compilation of JUnit tests
-post-compile-test: called after javac compilation of JUnit tests
-pre-compile-test-single: called before javac compilation of single JUnit test
-post-compile-test-single: called after javac compilation of single JUunit test
-pre-jar: called before JAR building
-post-jar: called after JAR building
-post-clean: called after cleaning build products
(Targets beginning with '-' are not intended to be called on their own.)
Example of inserting an obfuscator after compilation could look like this:
<target name="-post-compile">
<obfuscate>
<fileset dir="${build.classes.dir}"/>
</obfuscate>
</target>
For list of available properties check the imported
nbproject/build-impl.xml file.
Another way to customize the build is by overriding existing main targets.
The targets of interest are:
-init-macrodef-javac: defines macro for javac compilation
-init-macrodef-junit: defines macro for junit execution
-init-macrodef-debug: defines macro for class debugging
-init-macrodef-java: defines macro for class execution
-do-jar-with-manifest: JAR building (if you are using a manifest)
-do-jar-without-manifest: JAR building (if you are not using a manifest)
run: execution of project
-javadoc-build: Javadoc generation
test-report: JUnit report generation
An example of overriding the target for project execution could look like this:
<target name="run" depends="iDA-impl.jar">
<exec dir="bin" executable="launcher.exe">
<arg file="${dist.jar}"/>
</exec>
</target>
Notice that the overridden target depends on the jar target and not only on
the compile target as the regular run target does. Again, for a list of available
properties which you can use, check the target you are overriding in the
nbproject/build-impl.xml file.
-->
</project>
And here is the manifest file
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.8.2
Created-By: 1.7.0-b147 (Oracle Corporation)
Class-Path: lib/beansbinding-1.2.1.jar lib/AbsoluteLayout.jar lib/appf
ramework-1.0.3.jar lib/swing-worker-1.1.jar lib/swing-layout-1.0.4.ja
r lib/commons-codec-1.4.jar lib/commons-codec-1.5.jar lib/commons-log
ging-1.1.1.jar lib/derby.jar lib/derbyLocale_cs.jar lib/derbyLocale_d
e_DE.jar lib/derbyLocale_es.jar lib/derbyLocale_fr.jar lib/derbyLocal
e_hu.jar lib/derbyLocale_it.jar lib/derbyLocale_ja_JP.jar lib/derbyLo
cale_ko_KR.jar lib/derbyLocale_pl.jar lib/derbyLocale_pt_BR.jar lib/d
erbyLocale_ru.jar lib/derbyLocale_zh_CN.jar lib/derbyLocale_zh_TW.jar
lib/derbyclient.jar lib/derbynet.jar lib/derbyrun.jar lib/derbytools
.jar lib/httpclient-4.1.2.jar lib/httpclient-cache-4.1.2.jar lib/http
core-4.1.2.jar lib/httpmime-4.1.2.jar lib/jdom.jar lib/orangevolt-ant
-tasks-1.3.8.jar
X-COMMENT: Main-Class will be added automatically by build
Main-Class: lmb.LMBApp
NOTE:
Here I FOUND THE SOURCE OF THIS ISSUE BUT I DON'T KNOW HOW TO FIX IT,
Everything about library referencing and environment variables are ok except the fact that I'm not getting my SSL connection to the server while launching the jar file whereas the connection is easily made while running the application from inside Netbeans. In fact I'm getting this following Exception when executing through the final jar fine,
javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated at sun.security.ssl.SSLSessionImpl.getPeerCertificates(Unknown Source)
PLEASE HELP ME WITH THIS
Likely the first one uses a compilation (or execution) classpath, while the second one relies on an environment classpath (the jar doesn't include all your app's dependencies).
All of the items in your manifest need to be added to the classpath call.
This may contain a list of dependency jars which you could include on the command line using the -classpath options
java -cp gen/jars/test.jar -jar project.jar
You could inline the Ant build.xml and/or exceptions thrown so we can give you more information.

Categories

Resources