Problems with java add-ins

4516
17
05-23-2012 05:10 AM
AlbertoDe_Luca
New Contributor
Hello everyone.

Since ArcGIS 10 supports java for desktop development too, I tried to set up a java add-in for ArcMap. Before writing my own add-in I had a go with one of the samples provided by the Java SDK, called "simpleaddin".

I can add the add-in to ArcMap without problems, and I can see it listed in the Add-In Manager.

Unfortunately, when I bring up the add-in toolbar (SampleJava Toolbar) in ArcMap, no custom commands are shown, just a bunch of labels saying "missing". Native ArcMap commands (like Fixed Zoom Out) are visible on the toolbar though (see attached image).

I also tried to create my own add-in, following the instructions given in this video:

http://resources.arcgis.com/gallery/video/java/details?entryID=F8A0A38E-1422-2418-7FA3-CC2C83ED9674

but in this case I couldn't even find my custom command in the commands list under "Customize".

I tried on two boxes, both running win7/64 and ArcMap w/ the most recent SP available installed.

Any clues?

Thanks a bunch
Alberto
0 Kudos
17 Replies
LeoDonahue
Occasional Contributor III
I don't think the sample Java Add-ins work right, as that is how the toolbar appears when I run it.

Normally, Java Add-ins deploy to a Command Category called "Java Commands", unless you created a toolbar and added those commands to the toolbar.

Have you read through this tutorial?

http://help.arcgis.com/en/sdk/10.0/java_ao_adf/conceptualhelp/engine/0001/0001000003m3000000.htm

Also, if you are developing under 10.0 on Windows 7, you can't use a 64-bit jvm, you still have to use the 32-bit jvm.
0 Kudos
AlbertoDe_Luca
New Contributor
Thank you ldonahue for your reply.

I went through that tutorial, and created a simple add-in with just one button popping up a message. The add-in installed ok (I got the "Installation succeeded" message, and the add-in is listed in the Add-in manager), but when I go to the Commands list to add the button to an existing toolbar, the "Java Commands" category (where the button is supposed to be) isn't even there.

I then checked my system's default JRE version, which actually was 64 bit. I removed it from the system, so now the default version is the 32 bit 1.7.0_02, but my problems are still here...

Any other suggestion?
Alberto
0 Kudos
LeoDonahue
Occasional Contributor III
What values did you give for the button's required fields in the attached screenshot?

In this example, you 'should' find a button called Test Button in the 'Java Commands' category.  Or if you named your category something other than 'Java Commands', then look in that category name for your button.
0 Kudos
AlbertoDe_Luca
New Contributor
ldonahue,

the values are "New Button 1" and "Java Commands" (these are the names listed in the Add-In manager too). Nevertheless, the category "Java Commands" doesn't even exists in the Commands list.

What configuration do you have? Is your system 32 or 64 bit? I feel like I'm missing something big here, because from the tutorials setting up a java arcmap add-in seems like a piece of cake... Maybe my service pack version is bugged (AG10 w/ sp4)? Maybe special privileges are needed?

Alberto
0 Kudos
LeoDonahue
Occasional Contributor III
I'm using:
Eclipse Indigo 3.7.1
Java 1.6.0_29 32-bit SDK
ArcGIS Desktop 10.0 SP4
Windows 7 SP1

If you have ArcMap open, remove your add-in using the add-in manager, close ArcMap, and re-export your add-in.  Launch ArcMap again, do you see your command now?

Are you creating an add-in for ArcMap?
0 Kudos
AlbertoDe_Luca
New Contributor
Ok,

you've got my same setup (i've got win7/64 though).

I did what you advised:
- removed my add-in from add-in manager
- re-exported the add-in from eclipse (yes, it's an arc-map add-in)
- re-added add-in to arcmap (see attached screen cap, left)
- command still not available on command list (see screen cap, right)

[ATTACH=CONFIG]14687[/ATTACH]

D'oh!

Alberto
0 Kudos
DorisRiedl
New Contributor
I had a similar problem last week. My AddIn category did not appear. It was a blank at the end of the category name, that caused this problem.
0 Kudos
AlbertoDe_Luca
New Contributor
Thank you dorisriedl,

I've checked and made sure there were no blanks in my command and category names. I also removed the space between "Java" and "Commands". No luck.

Alberto
0 Kudos
LeoDonahue
Occasional Contributor III
Alberto,

Can you post a screenshot of your config.xml as seen in Eclipse?
0 Kudos