public class TClrHost
extends java.lang.Object
Constructor and Description |
---|
TClrHost() |
Modifier and Type | Method and Description |
---|---|
static void |
activate(java.lang.String email,
java.lang.String licenseKey)
Activates dotNet4Java copy with the distribution license details.
|
public static final void activate(java.lang.String email, java.lang.String licenseKey)
If the final solution of your java application (which uses dotNet4Java) is a JAR package file, then before using dotNet4Java in your application, you must first activate your licence. Your license can be activated in your code using this static method or add a dotNet4Java.xml file to the root of your java application. The purpose of this activation is to ensure that your JAR package built with the dotNet4Java can be used in any Java development environment.
To activate dotNet4Java in your code:
public static void main(String[] args) { TClrHost.activate("your@email.com", "YOUR-DISTRIBUTION-LICENSE-KEY"); //Todo: Your dotNet4Java powered application code }
Activating dotNet4Java through an XML configuration file: There are many benefits to activating and setting up dotNet4Java using an XML configuration file. It simplifies distribution of your application as JAR to your client, and avoids hardcoded activation details. During the first application use, dotNet4Java searches for, and then automatically uses the XML configuration file to activate your application. Simply name the file “dotNet4Java.xml” and place it in the root directory of your Java application .
<?xml version="1.0" encoding="ISO-8859-1" ?>
<dotNet4Java>
<activation>
<email>your@email.com</email>
<licencekey>YOUR-DISTRIBUTION-LICENSE-KEY</licencekey>
</activation>
</dotNet4Java>
email
- Your distribution license email address.licenseKey
- Your distribution license key.