Eclipse – how tos and tips and tricks

Lots of Java ADF enthusiasts have asked for some guidance on working with Eclipse. I do teach them a few in the class but here is more comprehensive listing. Obviously you can find more info on the web but here is a list that is relevant to using Eclipse for web development.

1. Increasing the heap size of Eclipse (In simple terms : how to avoid out of memory errors)Two ways to deal with this issue :

  • Start Eclipse with an extra argument to the VM indicating the memory size
    eclipse -vmargs -Xmx512M
  • Edit the eclipse.ini file (located in eclipse home directory) and add the modify the vmargs values. Here is a sample
    Old:
    -vmargs
    -Xms40m
    -Xmx256m
    New:
    -vmargs
    -Xms40m
    -Xmx756m

2. How to get the intellisense for code completion.

Ctrl + Space bar

3. When deploying the application to Tomcat, sometimes you get an error saying the “JRE was not found”

– From the Menu items open the “Window” -> “Preferences”

– Select the “Server” -> “Installed Runtimes” option

eclipse-installed-runtime.jpg

– Select “Apache Tomcat” and click on “Edit” button

eclipse-set-jre.jpg

– In the window make sure you choose a valid JRE. Click on the “Finish” button.

4. What plugins do I need to start using Java ADF with Eclipse?

There is detailed documentation on how to install Java ADF plugins for Eclipse on EDN. Here is the link :

http://edndoc.esri.com/arcobjects/9.2/Java/java/engine/ide_integration/eclipse/EclipseInstall.html

Here is a screenshot for reference showing all the plugins (including Java ADF plugins) installed in my Eclipse :

eclipse-plugins.jpg

5. When you run the web mapping application template you get this error in the console though the application runs fine java.io.NotSerializableException: com.esri.adf.web.tasks.MapToolsTaskInfo

The reason is that the container (Example: Tomcat) tries to serialize the objects in session. Add a new context.xml file inside the META-INF folder of you app. Put these lines inside the xml file:

<Context>
 <WatchedResource>WEB-INF/web.xml</WatchedResource>
</Context>

Thats It folks! Save and run the app.

More coming soon …

Advertisements

2 Responses to “Eclipse – how tos and tips and tricks”

  1. crusader extreme Says:

    Good thread, i like this tips :)

  2. iamlaksh1 Says:

    Sathya, can you write something about debugging ArcObjects using Debuging plugin recently released by ESRI. How to use, how to debug using immediate window etc etc..


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: