You can execute the resulting jar file directly The actual jar file's bytes will beĪppended to that native binary, creating a single binary blob containing both theĮxecutable and the Java code. Your rule, all linked into a static binary. This will contain the launcher plus any native (C++) dependencies of These are automatically loadedĪttribute, then instead of being a normal JAR file, the _deploy.jar will be a It alsoĬontains the native libraries needed for dependencies. Searched the classpath from the binary's wrapper script from beginning to end. The deploy jar contains all the classes that would be found by a classloader that Using the wrapper script is preferred to java -jar because itĪlso passes the JVM flags and the options Java -jar command or with the wrapper script's -singlejar
name_deploy.jar: A Java archive suitable for deployment (onlyīuilding the _deploy.jar target for your ruleĬreates a self-contained jar file with a manifest that allows it to be run with the.name-src.jar: An archive containing the sources ("source.Resources corresponding to the binary's direct dependencies. name.jar: A Java archive, containing the class files and other.src/main/java/com/google/devtools/build/lib/bazel/rules/java/java_stub_template.txtįor a list of configurable flags and environment variables accepted by the wrapper. The wrapper script accepts several unique flags. The wrapper shell script uses a classpath that includes, among other things, a jar file for each Java_binary( name, deps, srcs, data, resources, args, classpath_resources, compatible_with, create_executable, deploy_env, deploy_manifest_lines, deprecation, distribs, env, exec_compatible_with, exec_properties, features, javacopts, jvm_flags, launcher, licenses, main_class, output_licenses, plugins, resource_jars, resource_strip_prefix, restricted_to, runtime_deps, stamp, tags, target_compatible_with, testonly, toolchains, use_launcher, use_testrunner, visibility)īuilds a Java archive ("jar file"), plus a wrapper shell script with the same name as the rule.