java

package
v1.14.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 25, 2025 License: Apache-2.0 Imports: 12 Imported by: 1

README

Building Wrapper

We embed user code into the wrapper Jar. The build process should create user-handler.jar in the current directory before calling gradle shadowJar

See code in pkg/processor/build/runtime/java/runtime.go

Documentation

Overview

Package java implements a Java runtime

To implement a handler you need to write a class the implements io.nuclio.EventHandler.

`nuctl build` does the following logic, depends on the value of `-p`: - If it's a jar, use it - If it's a directory and there's `handler.jar` there, use it - If it's a directory with only single jar (including subdirectories), use it - If there's a `build.gradle` file there - run `nuclioJar` task and use jar from `build` directory - If there's no `build.gradle`, generate one, build annd use jar from `build` directory

Build will work also if the path passed is a single Java file. You can specify dependencies using (inline in Java file or Jar) build configuration.

// @nuclio.configure // // function.yaml: // spec: // build: // dependencies: // - group: com.google.code.gson // name: gson // version: 2.8.9 // - group: com.google.guava // name: guava // version: 23.6-jre

The default image is using OpenJDK 11 If you have dependencies in other packages, create a fat/uber Jar with all the dependencies. We currently do not support maven/sbt/ant/... builds.

You can specify JVM options in the configuration as well, i.e.:

// @nuclio.configure // // function.yaml: // spec: // runtimeAttributes: // jvmOptions: // - -Xms128m // - -Xmx512m

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRuntime

func NewRuntime(parentLogger logger.Logger, configuration *runtime.Configuration) (runtime.Runtime, error)

NewRuntime returns a new Java runtime

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL