How can i config arcgis runtime for java?

1514
3
Jump to solution
07-21-2021 07:53 PM
亚鹏范
New Contributor II

first,thanks for watching.

details is following:

i'm trying to carry out the official sites's tutorials case - [maps2d>tutorials>display a map] links.

then i had some problems and i sloves them by means of the internet. it seems like everything looks going well.

but , I was in a trouble while i try to run it.

 

it seems to be related to arcgis runtime .the error prompt is following.

and i'm using is that jdk11、javafx11,all are the latest in reference to the official website's doc.

 

Initializing...
Java version : 15.0.2 (Oracle Corporation) amd64
Exception in Application start method
Exception in Application stop method
Exception in thread "main" java.lang.RuntimeException: Exception in Application start method
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:900)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
at java.base/java.lang.Thread.run(Thread.java:832)
Caused by: java.lang.ExceptionInInitializerError
at com.esri.arcgisruntime.mapping.view.MapView.create(MapView.java:93)
at com.esri.arcgisruntime.mapping.view.MapView.<init>(MapView.java:87)
at cn.fc88804.arcgis.App.start(App.java:47)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:846)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:455)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
... 1 more
Caused by: java.lang.RuntimeException: Could not find runtime in any of:
- A directory specified by calling ArcGISRuntimeEnvironment.setInstallDirectory()
- The current directory D:\WorkSpace\Spring Tool Suits\sts_workspace\ArcGis
- A location specified by the environment variable ARCGISRUNTIMESDKJAVA_100_11_2
- Within the ".arcgis" directory in the user's home path C:\Users\Administrator\.arcgis
at com.esri.arcgisruntime.ArcGISRuntimeEnvironment.lambda$getInstallDirectory$0(ArcGISRuntimeEnvironment.java:262)
at java.base/java.util.Optional.orElseThrow(Optional.java:401)
at com.esri.arcgisruntime.ArcGISRuntimeEnvironment.getInstallDirectory(ArcGISRuntimeEnvironment.java:258)
at com.esri.arcgisruntime.ArcGISRuntimeEnvironment.loadNativeLibraries(ArcGISRuntimeEnvironment.java:693)
at com.esri.arcgisruntime.ArcGISRuntimeEnvironment.initialize(ArcGISRuntimeEnvironment.java:198)
at com.esri.arcgisruntime.internal.jni.CoreGeoView.<clinit>(CoreGeoView.java:52)
... 12 more

 

 

thans again!!!

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
DaveWhitla
New Contributor III

Rachel describes the cause correctly.

Depending upon your development environment there are a few ways to correct it.

Are you using Maven or Gradle to build your application, or some other method?

The simplest options are documented here in the SDK installation guide.

In that guide you will see that the SDK depends upon two additional compressed archives at runtime. You must make those archives (unpacked) available to the SDK and configure the SDK within your app with the location of these dependencies.

The error message you are receiving indicates where the SDK is looking for the required files:

Could not find runtime in any of:
- A directory specified by calling ArcGISRuntimeEnvironment.setInstallDirectory()
- The current directory D:\WorkSpace\Spring Tool Suits\sts_workspace\ArcGis
- A location specified by the environment variable ARCGISRUNTIMESDKJAVA_100_11_2
- Within the ".arcgis" directory in the user's home path C:\Users\Administrator\.arcgis

View solution in original post

0 Kudos
3 Replies
亚鹏范
New Contributor II

some here?please!

0 Kudos
RachaelE
New Contributor

Hello, 

It looks like the ArcGIS Runtime for Java is missing from the machine you are using: are you running the downloaded solution for the tutorial from your machine, or following the tutorial instructions step by step?

For both scenarios, try running the `copyNatives` gradle task. This should copy Runtime into an `.arcgis` directory on your machine. Can you see Runtime in there at all? If you open `.arcgis` up you should see a `100.11.0` folder and within that a jniLibs and resources folder.

0 Kudos
DaveWhitla
New Contributor III

Rachel describes the cause correctly.

Depending upon your development environment there are a few ways to correct it.

Are you using Maven or Gradle to build your application, or some other method?

The simplest options are documented here in the SDK installation guide.

In that guide you will see that the SDK depends upon two additional compressed archives at runtime. You must make those archives (unpacked) available to the SDK and configure the SDK within your app with the location of these dependencies.

The error message you are receiving indicates where the SDK is looking for the required files:

Could not find runtime in any of:
- A directory specified by calling ArcGISRuntimeEnvironment.setInstallDirectory()
- The current directory D:\WorkSpace\Spring Tool Suits\sts_workspace\ArcGis
- A location specified by the environment variable ARCGISRUNTIMESDKJAVA_100_11_2
- Within the ".arcgis" directory in the user's home path C:\Users\Administrator\.arcgis

0 Kudos