K2BTools.Common does not exist

Introduction

Since version K2BTools 8.0, an external object is used to read properties in the web.config in .Net or client.cfg in Java. This external objects is implemented with a dll (K2BToolsCommon.dll) in .Net and with a Jar file in java (K2BToolsCommon.jar). In Java environments, if the Jar file is not in the classpath and the classpath is not using GeneXus' default value, a compilation error will be thrown. In this page we will explain how to fix this problem.

Error: \SdtK2BToolsGXPreferences.java:127: package K2BTools.Common does not exist
   public K2BTools.Common.GXPreferences getExternalInstance( )

This error means that K2BToolsCommon.jar is not in the classpath. In order to solve this problem you have two options

  1. Set java environment classpath property to its default value 
    DefaultValueToClasspathProperty
    Set the default value to the classpath property

  2. Add K2BToolsCommon.jar manually to the classpath. The jar file is in the Web\drivers\ folder inside your model. 

If you have any doubts don't hesitate to contact K2BTools support at support@k2btools.com.