Updating UDx Projects: Syncing the Vertica Plug-in for Eclipse with New Vertica Versions

Posted February 7, 2017 by Soniya Shah, Information Developer

The Vertica SDK Plug-in for Eclipse version 7.1.2 creates UDxs that are compatible with Vertica version 7.1.x. By replacing two files (BuildInfo.java and VerticaSDK.jar) in projects created with this plug-in, you can update your project to work with newer versions of Vertica. You get the replacement files (/opt/vertica/sdk/BuildInfo.java and /opt/vertica/bin/VerticaSDK.jar) from your currently installed Vertica version, such as 7.2 or 8.x.

Note: These steps update a project created using the Vertica 7.1.2 plug-in to work with 7.2 or 8.x. They do not change the Eclipse plug-in.

This blog assumes that you are developing your Java UDx on a system that has the targeted version of Vertica installed on it.

Here’s what you need to do to create an Eclipse UDx project compatible with newer versions of Vertica:
  1. Exit Eclipse if it is currently running.
  2. If you have not already installed the Vertica SDK Plug-in, save it in the Eclipse dropins folder. For example, if your installation of Eclipse is in your home directory’s /eclipse/java-neon directory, verify that you have the plug-in installed by using these commands:
    # cd ~/eclipse/java-neon/eclipse/dropins
    # ls -ltr
    total 380
    -rw-r–r– 1 root root 386182 Jan 4 12:39 com.vertica.sdk.eclipseplugin.v7.1.2.jar
  3. Launch Eclipse.
  4. Click New > Other.
  5. Verify that the Vertica 7.1.2 Java SDK plug-in is available within Eclipse:

  6. Select Vertica UDX Project and click Next.
  7. In the Project Name box, enter a name for your UDx project, for example Count Words.
  8. Click Finish.
  9. View your new project in the Project Explorer window.
  10. Expand the src and Referenced Library folders. Now you see the BuildInfo.java and VerticaSDK.jar files that are specific to Vertica version 7.1.2. These are the files that you must replace with the latest versions.

  11. Copy the file /opt/vertica/sdk/BuildInfo.java to your project’s /src/com/vertica/sdk/ directory. For example, if you are developing a UDx project named Count Words, use the following commands to copy the file:
    # cp /opt/vertica/sdk/BuildInfo.java ~/eclipse/workspace/Count\ Words/src/com/vertica/sdk/BuildInfo.java
    # ls -ltr ~/workspace/Count\ Words/src/com/vertica/sdk/BuildInfo.java
    -rw-rw-r– 1 root root 1850 Jan 4 12:52 /root/eclipse/workspace/CountWords/src/com/vertica/sdk/BuildInfo.java
  12. 12. Copy both /opt/vertica/bin/VerticaSDK.jar and /opt/vertica/sdk/BuildInfo.java to the directory where the VerticaSDK.jar file is currently installed. You find this path by looking at the VerticaSDK.jar entry under the Reference Libraries folder in the Project Explorer.
  13. Now you are ready to build a Java UDx to work with an installed Vertica version such as 7.2.3-9. The steps discussed in this method also work with 8.x.
    dbadmin=> select version();

    Vertica Analytic Database v7.2.3-9
    (1 row)

    dbadmin=> CREATE LIBRARY wordCountLib AS ‘/tmp/CountWordsUDxLib.jar’ LANGUAGE ‘Java’;


For more information, see Developing UDx in Java Tutorial Part 1: Introduction and Setting Up.