To compile the source code for your Java routine, you need javFnc.jar, the Teradata Java external stored procedure and UDF runtime library.
IF you compile the source code on ... | THEN ... |
---|---|
your client system | download the runtime library from Teradata Downloads. |
the database system | the runtime library is already available. |
Add the path to the runtime library to your class path (or use the -classpath option of the Java compiler). For details on the location of the runtime library on a database system, see Class Path.
For example, suppose you downloaded javFnc.jar to C:\java_xsp on your Windows client. You can compile the source code in region.java as follows:
javac -classpath C:\java_xsp\javFnc.jar region.java
The version of the class file that you generate when you compile the Java source code must be compatible with the JRE on the database system.
For example, suppose the database uses JRE 1.8 and your client system uses JDK 8.0. To compile the source code in region.java on your client system, you can use the -target option of the Java compiler.
javac -target 1.8 -classpath C:\java_xsp\javFnc.jar region.java
To determine the version of the JRE on the database system, use the cufconfig utility to see where the JRE was installed. For more information, see Teradata Vantageā¢ - Database Utilities, B035-1102.