Getting Started With iControl And Java – Setting Up Eclipse
This is the first article in a series focused on developing iControl applications with the Java language. I’ve picked Eclipse development platform for this set of platforms. The goal here is to give you the directions and tools you need to make the most out of iControl when you are involved with Java development.
For this article, I’m going to assume that you are starting off of a clean system. In most cases, you will already have one or more of the prerequisites installed so you can feel free to ignore that section. This article was developed with all the components on a Windows 7 System, but everything should work similarly on other platforms.
The Pieces To The Puzzle
The first item you will need to install is Java itself. This can be downloaded from the Java Website At Oracle.com. There are a lot of different versions of Java but I always stick to the bare bones “Java SE” JDK distribution.
I’m not going to walk through the installation of Java as I assume you can figure that one out for yourself. If you are really stuck, do a Google Search for “How To Install Java” and that should point you in the right direction.
Eclipse is an open source development platform build with extensible frameworks, tools and runtimes for many different languages – Java being one of them. The JDT (Java Development Tools) project provides the tool plug-ins that implement a Java IDE supporting the development of any Java application.
To install Eclipse for Java, visit the downloads page at http://www.eclipse.org/downloads/ and select the appropriate “Eclipse IDE for Java Developers distribution. Even though I am running 64-bit windows, I had an issue getting the 64-bit build of Eclipse to work. This was possibly due to the version of Java I had installed. So, I picked the “Windows 32 Bit” download and it worked out find.
The download is just a .zip file containing the product directory. Just unzip this to a location of your choosing.
At this point you should have a development environment setup for building Java applications. The last piece of the puzzle is the iControl libraries for Java. iControl is a set of Web Services and we have taken the Web Service Description Language (WSDL) files, built client proxy code for them, and packaged them within a nice wrapper class and packed them into a Java library to make it as easy as possible for you to integrate iControl into a new or existing Java application.
To get the libraries, you’ll need to visit the iControl Assembly (we have a .Net version as well) Labs project on DevCentral and click on the “Discussions and Downloads” link. From there Click into the latest release in the “Downloads” section (as of now it is at iControl v10.2) and download the “Java Binary Distribution” release. The “Java Source Distribution” is available if you want to see how I built the library.
The binary download will include two directories: Lib and 3rdparty. The client proxy code was built with Apache Axis so we’ve included those libraries to include in your projects as well so that you don’t have to go hunting elsewhere for all the other dependent libraries. Unzip this directory somewhere on your disk (ie \iControl\javalib).
Building Your First Project
I figured that a video would be easier to follow than me describing the steps it takes to create a project and import the iControl libraries in it so I make this walkthrough where I:
- Created a new Java project in Eclipse.
- Imported the iControl Library for Java and associated 3rd party libraries.
- Created a class with a Main method to be used as a console application.
- Created an instance of the iControl.Interfaces object.
- Initialized the iControl.Interfaces object with the credentials for my BIG-IP.
- Added logic to query the System information and output that to the console.
- Debug and demonstrate the application.
I did all that in 5 minutes! …with a little help from cut-and-paste B-).
Conclusion
You should now be able to build a Java application to make use of the automation features of your BIG-IP. In future articles, I will illustrate other aspects of the iControl API with Java.
Download
The Java class for this example can be downloaded from the iControl CodeShare under JavaSystemInfo.
Related Articles on DevCentral
- More caffeine please...
- Simple Ways to Make iControl Development Easier with Java Tools ...
- iControl Tech Tips Archive
- Java assembly version - DevCentral - F5 DevCentral > Community ...
- iControl Quickstart for Java > DevCentral > F5 DevCentral > Tech Tips
- Updating domain info using iControl - DevCentral - F5 DevCentral ...
- sindhujit_28441Nimbostratus
where is the walk through video? ?????? Its been 4 years and still its not uploaded
- mcaballe_135435NimbostratusIs the walk through video still available? Is there another link to it?
- mcaballe_135435NimbostratusIs the walk through video still available? I did not see it.
- @clazba - not sure what's going wrong with your setup. It looks from the stack trace that apache axis is getting an end of file exception when trying to access your keystore. I'm not a java expert by any means so if anyone has any ideas, I'd love to hear them.
- Raj_126122NimbostratusHi,
- clazbaNimbostratusHiya, the walk-through video (https://devcentral.f5.com/s/articles/f5-programmability-for-eclipse-installation-instructions-20883) does not seem to work -- I can only see a still image of some code for a few seconds. Can you please re-upload as it illustrates a critical part of the process? thanks!!