I'm creating an Add-in for ArcMap 10.1.
When I export file testproject.esriaddin and install (whether double-click or from Customize Mode> Add From File dialog), message of success appears. But then, I can't find any of my elements in Customize Mode dialog (no Java Tools or Java Commands category, no toolbar in toolbars...).
I found this topic, which seemed to be about the same problem. There, the solution was to select JRE: Java SE 1.6 instead of 1.7. I set this in my project, but the Add-in is still not working.
What could be wrong?
Here is my java class for the button:
package cz.upol.geoinformatics.veselka;
import java.io.IOException;
import javax.swing.JOptionPane;
import com.esri.arcgis.addins.desktop.Button;
//import com.esri.arcgis.arcmapui.IMxDocument;
import com.esri.arcgis.framework.IApplication;
import com.esri.arcgis.interop.AutomationException;
public class Button1 extends Button {
private IApplication app;
//private IMxDocument projectDocument;
/**
* Called when the button is clicked.
*
* @exception java.io.IOException if there are interop problems.
* @exception com.esri.arcgis.interop.AutomationException if the component throws an ArcObjects exception.
*/
@Override
public void onClick() throws IOException, AutomationException {
JOptionPane.showMessageDialog(null, "Hello, World!");
}
@Override
public void init(IApplication app){
this.app = app;
//this.projectDocument = (IMxDocument)app.getDocument();
}
}
Here is how it looks after deploy to ArcMap: Add-in Manager in ArcMap
I use ArcGIS + SDK 10.1 on Windows 7 32bit and Eclipse 4.3
Did I forgot to mention some details?
Edit: Here is my another screenshot: (You can see, that category Java Commnads is not listed in Categories) Screenshot Eclipse + ArcGIS Customize window
-
I'm not a java developer but looking at your code it looks like you have created a button. From your screenshoot it looks like you have installed the addIn called "Test Add-In". You need to go to Customize > Customize mode > Commands tab and find the category you created the button in. That is documented in the esriconfig file.Hornbydd– Hornbydd2014年05月06日 15:15:28 +00:00Commented May 6, 2014 at 15:15
-
I did. As I've written in the second paragraph. You can see on my another screenshot, that category "Java Commands" is not listed.Jonáš Veselka– Jonáš Veselka2014年05月06日 15:24:36 +00:00Commented May 6, 2014 at 15:24
-
Just thinking out aloud here, In VB .net one needs to set the button image (in your case fuzzy-icon.jpg) to build action AddInContent, is that the same as in java? Also I tend to use bmp or png I did not know jpg was supported? In VB .net its framework 3.5 and I tend to set target cpu to x86 if these are relevant to java?Hornbydd– Hornbydd2014年05月06日 15:48:47 +00:00Commented May 6, 2014 at 15:48
-
I don't think that it would be caused by image type. Image is optional. I changed it to PNG, but the result is same. What do You mean with setting target cpu to x86? I use x86 system.Jonáš Veselka– Jonáš Veselka2014年05月06日 20:59:23 +00:00Commented May 6, 2014 at 20:59
-
ArcGIS is 32bit but you may be developing on a Windows 7 64bit machine and this can sometimes upset things, general advice on various forums is to set the build to compile to x86 rather than accept the default AnyCPU. I have to admit I'm talking from a VB perspective here so no idea if this is even relevant for java?Hornbydd– Hornbydd2014年05月06日 22:52:01 +00:00Commented May 6, 2014 at 22:52
1 Answer 1
I solved the problem by reinstalling ArcGIS, Java and also .NET Framework. So, I didn't figure out which part was causing it.
My steps:
- Uninstalled ArcGIS 10.1, Java 1.7 (JRE and JDK) and .NET framework (probably 4.5.1) from my computer.
- Used The .NET cleanup tool.
- (Installed trial version of ArcGIS 10.2.1, but couldn't get ArcObjects SDK, then uninstalled.)
- Installed ArcGIS.
Installed Java 1.6
At this time, everything was finaly working correctly!
Installed .NET 4.5.1 through the Windows Update
Everything is still working.
-
having the same issue, unfortunately this answer doesn't help.Julio– Julio2015年04月27日 00:04:53 +00:00Commented Apr 27, 2015 at 0:04
Explore related questions
See similar questions with these tags.