This topic describes the Java runtimes that Function Compute supports for writing your function code.
Background
Unlike scripting languages such as Python and Node.js, Java code must be compiled before it can be run on a Java virtual machine (JVM). In this context, the following limits apply when you use Function Compute.
Code compilation not supported: You can upload only developed and compiled ZIP packages or JAR packages. Function Compute does not support Java-based compilation.
Online editing not supported: You cannot edit code online because it cannot be uploaded. You can only submit code by uploading JAR packages or using Object Storage Service (OSS).
Java runtimes
The following table lists the Java runtimes that are supported by Function Compute.
Version | Operating system | Architecture |
Java 11 | Linux | x86_64 |
Java 8 | Linux | x86_64 |
Function Compute provides the following dependencies for Java runtimes:
com.aliyun:fc-java-core
: defines information such as the handler interfaces and context objects.com.aliyun:fc-java-events
: provides the event types of common event sources.FC SDK for Java
: the official Function Compute SDK for Java SDK.