Getting going with the TFS Java API

If you are using the TFS 2012 Java API it is important you read the release notes. It is not enough to just reference the file in your classpath as you might expect. You also have to pass a Java system property that associates with the location of the native library files that provide platform specific implementation for method calls.  The command line for this is done in the form

java.exe -D"\Users\Username\YourApplication\native"

If you don’t set this property you get an exception similar to

Exception in thread "main" java.lang.UnsatisfiedLinkError:;)Ljava/lang/String;

Now setting this property on the command line is all well and good, but how do you do this if you are working in Eclipse?

The answer is you set the argument via the Run > Run Configuration. Select your configuration and enter the VM argument as shown below.


Once this is set you can run and debug you application inside Eclipse