drgis

How do you deploy an Java ArcObjects App?

Discussion created by drgis on Jul 6, 2011
I had an app running in AG 9.3.1. When migrating it to AG10 I started having problems with the runnable jar. Finally I decided to try an example an see if it was mya code: But I´m getting the same errors.
Here´s what I do:
1. From eclipse I create a runnable jar with the option "Package required libaries into generated JAR"
2. When I run from command line java -jar create-worldfile.jar I get the following exception:

C:\ws_352\CreateWorldFile\target>java -jar create-worldfile.jar
Starting CreateWorldFile - An ArcObjects Java SDK Developer Sample
java.lang.IllegalArgumentException: URI is not hierarchical
        at java.io.File.<init>(File.java:363)
        at com.esri.arcgis.interop.NativeLoader.getArcGISHome(Unknown Source)
        at com.esri.arcgis.interop.NativeLoader.loadLibrary(Unknown Source)
        at com.esri.arcgis.system.EngineInitializer.initializeEngine(Unknown Source)
        at arcgissamples.raster.CreateWorldFile.main(CreateWorldFile.java:51)
        at arcgissamples.loadsample.Main.main(Main.java:26)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:56)
java.lang.NullPointerException
        at com.esri.arcgis.interop.NativeLoader.getArcGISHome(Unknown Source)
        at com.esri.arcgis.interop.NativeLoader.loadLibrary(Unknown Source)
        at com.esri.arcgis.system.EngineInitializer.initializeEngine(Unknown Source)
        at arcgissamples.raster.CreateWorldFile.main(CreateWorldFile.java:51)
        at arcgissamples.loadsample.Main.main(Main.java:26)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:56)

If I run from within the IDE it works fine.

I would appreciate any help you can give me.

Outcomes