Make the embedded JDK targets the default

Closes #5403.

PiperOrigin-RevId: 201007405
diff --git a/compile.sh b/compile.sh
index 48359e3..ed506d2 100755
--- a/compile.sh
+++ b/compile.sh
@@ -92,11 +92,11 @@
 log "Building output/bazel"
 # We set host and target platform directly since the defaults in @bazel_tools
 # have not yet been generated.
-bazel_build "src:bazel${EXE_EXT}" \
+bazel_build "src:bazel_nojdk${EXE_EXT}" \
   --host_platform=@bazel_tools//platforms:host_platform \
   --platforms=@bazel_tools//platforms:target_platform \
   || fail "Could not build Bazel"
-bazel_bin_path="$(get_bazel_bin_path)/src/bazel${EXE_EXT}"
+bazel_bin_path="$(get_bazel_bin_path)/src/bazel_nojdk${EXE_EXT}"
 [ -e "$bazel_bin_path" ] \
   || fail "Could not find freshly built Bazel binary at '$bazel_bin_path'"
 cp -f "$bazel_bin_path" "output/bazel${EXE_EXT}" \
diff --git a/scripts/BUILD b/scripts/BUILD
index 3ff56c4..31e8958 100644
--- a/scripts/BUILD
+++ b/scripts/BUILD
@@ -10,14 +10,14 @@
     outs = ["bazel-complete.bash"],
     cmd = " ".join([
         "$(location :generate_bash_completion.sh)",
-        "--bazel=$(location //src:bazel_with_jdk)",
+        "--bazel=$(location //src:bazel)",
         "--output=$@",
         "--prepend=$(location bazel-complete-template.bash)",
     ]),
     output_to_bindir = 1,
     tools = [
         ":generate_bash_completion.sh",
-        "//src:bazel_with_jdk",
+        "//src:bazel",
     ],
     visibility = ["//scripts/packages:__subpackages__"],
 )
diff --git a/scripts/packages/BUILD b/scripts/packages/BUILD
index 4a45619..ace087c 100644
--- a/scripts/packages/BUILD
+++ b/scripts/packages/BUILD
@@ -86,7 +86,7 @@
 
 genrule(
     name = "rename-bazel-bin",
-    srcs = ["//src:bazel_with_jdk"],
+    srcs = ["//src:bazel"],
     outs = ["with-jdk/bazel-real"],
     cmd = "mkdir -p $$(dirname $@); cp $< $@",
 )
diff --git a/src/BUILD b/src/BUILD
index 131eda9..4b96719 100644
--- a/src/BUILD
+++ b/src/BUILD
@@ -39,7 +39,7 @@
     }),
 ) for suffix, embedded_tools_target in {
     "": [":embedded_tools"],
-    "_with_jdk": [":embedded_tools_with_jdk"],
+    "_nojdk": [":embedded_tools_nojdk"],
     "_notools": [],
 }.items()]
 
@@ -173,13 +173,13 @@
         "//conditions:default": [
             "//src/tools/singlejar:singlejar",
         ],
-    }) + ([":embedded_jdk"] if (suffix == "_with_jdk") else []),
+    }) + ([":embedded_jdk"] if (suffix == "") else []),
     visibility = [
         "//src/test:__subpackages__",  # For integration tests
     ],
 ) for suffix in [
     "",
-    "_with_jdk",
+    "_nojdk",
 ]]
 
 filegroup(
@@ -207,7 +207,7 @@
     out = "embedded_tools" + suffix + ".params",
 ) for suffix in [
     "",
-    "_with_jdk",
+    "_nojdk",
 ]]
 
 genrule(
@@ -222,13 +222,13 @@
 )
 
 genrule(
-    name = "embedded_tools_with_jdk",
+    name = "embedded_tools_nojdk",
     srcs = [
-        ":embedded_tools_with_jdk_params",
-        ":embedded_tools_with_jdk_srcs",
+        ":embedded_tools_nojdk_params",
+        ":embedded_tools_nojdk_srcs",
     ],
-    outs = ["embedded_tools_with_jdk.zip"],
-    cmd = "$(location :create_embedded_tools) \"$@\" $(location :embedded_tools_with_jdk_params)",
+    outs = ["embedded_tools_nojdk.zip"],
+    cmd = "$(location :create_embedded_tools) \"$@\" $(location :embedded_tools_nojdk_params)",
     tools = [":create_embedded_tools"],
 )
 
@@ -253,7 +253,7 @@
 ) for suffix, embed in [
     ("", True),
     ("_notools", False),
-    ("_with_jdk", True),
+    ("_nojdk", True),
 ]]
 
 [genrule(
@@ -278,7 +278,7 @@
 ) for suffix in [
     "",
     "_notools",
-    "_with_jdk",
+    "_nojdk",
 ]]
 
 # Build an executable named `bazel.exe`.
@@ -299,7 +299,7 @@
 ) for suffix in [
     "",
     "_notools",
-    "_with_jdk",
+    "_nojdk",
 ]]
 
 filegroup(
diff --git a/src/test/py/bazel/BUILD b/src/test/py/bazel/BUILD
index 3763e6b..9087fe0 100644
--- a/src/test/py/bazel/BUILD
+++ b/src/test/py/bazel/BUILD
@@ -9,7 +9,7 @@
 filegroup(
     name = "test-deps",
     testonly = 1,
-    srcs = ["//src:bazel_with_jdk"],
+    srcs = ["//src:bazel"],
     data = ["//src/tools/remote:worker"],
 )
 
diff --git a/src/test/py/bazel/test_base.py b/src/test/py/bazel/test_base.py
index ea95f5b..4d52788 100644
--- a/src/test/py/bazel/test_base.py
+++ b/src/test/py/bazel/test_base.py
@@ -235,7 +235,7 @@
       (int, [string], [string]) tuple: exit code, stdout lines, stderr lines
     """
     return self.RunProgram([
-        self.Rlocation('io_bazel/src/bazel_with_jdk'),
+        self.Rlocation('io_bazel/src/bazel'),
         '--bazelrc=/dev/null',
         '--nomaster_bazelrc',
     ] + args, env_remove, env_add)
diff --git a/src/test/shell/bazel/BUILD b/src/test/shell/bazel/BUILD
index 49f93ff..430a00a 100644
--- a/src/test/shell/bazel/BUILD
+++ b/src/test/shell/bazel/BUILD
@@ -27,7 +27,7 @@
         "testing_server.py",
         ":langtools-copy",
         "//examples:srcs",
-        "//src:bazel_with_jdk",
+        "//src:bazel",
         "//src/java_tools/buildjar/java/com/google/devtools/build/buildjar/genclass:GenClass_deploy.jar",
         "//src/java_tools/junitrunner/java/com/google/testing/junit/runner:Runner_deploy.jar",
         "//src/main/tools:linux-sandbox",
@@ -520,7 +520,7 @@
     srcs = ["bazel_with_jdk_test.sh"],
     data = [
         ":test-deps",
-        "//src:bazel_with_jdk",
+        "//src:bazel",
     ],
     tags = ["no_windows"],
 )
diff --git a/src/test/shell/bazel/bazel_determinism_test.sh b/src/test/shell/bazel/bazel_determinism_test.sh
index a3f64ff..8abc11f 100755
--- a/src/test/shell/bazel/bazel_determinism_test.sh
+++ b/src/test/shell/bazel/bazel_determinism_test.sh
@@ -56,11 +56,11 @@
     unzip -q "${DISTFILE}"
 
     # Build Bazel once.
-    bazel --output_base="${TEST_TMPDIR}/out1" build --nostamp //src:bazel_with_jdk
+    bazel --output_base="${TEST_TMPDIR}/out1" build --nostamp //src:bazel
     hash_outputs >"${TEST_TMPDIR}/sum1"
 
     # Build Bazel twice.
-    bazel-bin/src/bazel_with_jdk --output_base="${TEST_TMPDIR}/out2" build --nostamp //src:bazel_with_jdk
+    bazel-bin/src/bazel --output_base="${TEST_TMPDIR}/out2" build --nostamp //src:bazel
     hash_outputs >"${TEST_TMPDIR}/sum2"
 
     if ! diff -U0 "${TEST_TMPDIR}/sum1" "${TEST_TMPDIR}/sum2" >$TEST_log; then
diff --git a/src/test/shell/bazel/bazel_with_jdk_test.sh b/src/test/shell/bazel/bazel_with_jdk_test.sh
index 98c0223..cf33345 100755
--- a/src/test/shell/bazel/bazel_with_jdk_test.sh
+++ b/src/test/shell/bazel/bazel_with_jdk_test.sh
@@ -21,8 +21,8 @@
 source $(rlocation io_bazel/src/test/shell/integration_test_setup.sh) \
   || { echo "integration_test_setup.sh not found!" >&2; exit 1; }
 
-function bazel_with_jdk() {
-  $(rlocation io_bazel/src/bazel_with_jdk) --bazelrc=$TEST_TMPDIR/bazelrc "$@"
+function bazel() {
+  $(rlocation io_bazel/src/bazel) --bazelrc=$TEST_TMPDIR/bazelrc "$@"
   return $?
 }
 
@@ -48,32 +48,32 @@
 }
 
 function test_bazel_uses_bundled_jdk() {
-  bazel_with_jdk --batch info &> "$TEST_log" || fail "bazel_with_jdk info failed"
-  install_base="$(bazel_with_jdk --batch info install_base)"
+  bazel --batch info &> "$TEST_log" || fail "bazel info failed"
+  install_base="$(bazel --batch info install_base)"
 
   # Case-insensitive match, because Windows paths are case-insensitive.
   grep -sqi -- "^java-home: ${install_base}/_embedded_binaries/embedded_tools/jdk" $TEST_log || \
-      fail "bazel_with_jdk's java-home is not inside the install base"
+      fail "bazel's java-home is not inside the install base"
 }
 
-# Tests that "bazel_with_jdk license" prints the license of the bundled JDK by grepping for
+# Tests that "bazel license" prints the license of the bundled JDK by grepping for
 # representative strings from those files. If this test breaks after upgrading the version of the
 # bundled JDK, the strings may have to be updated.
 function test_bazel_license_prints_jdk_license() {
-  bazel_with_jdk --batch license \
-      &> "$TEST_log" || fail "running bazel_with_jdk license failed"
+  bazel --batch license \
+      &> "$TEST_log" || fail "running bazel license failed"
 
   expect_log "OPENJDK ASSEMBLY EXCEPTION" || \
-      fail "'bazel_with_jdk license' did not print an expected string from ASSEMBLY_EXCEPTION"
+      fail "'bazel license' did not print an expected string from ASSEMBLY_EXCEPTION"
 
   expect_log "Provided you have not received the software directly from Azul and have already" || \
-      fail "'bazel_with_jdk license' did not print an expected string from DISCLAIMER"
+      fail "'bazel license' did not print an expected string from DISCLAIMER"
 
   expect_log '"CLASSPATH" EXCEPTION TO THE GPL' || \
-      fail "'bazel_with_jdk license' did not print an expected string from LICENSE"
+      fail "'bazel license' did not print an expected string from LICENSE"
 
   expect_log "which may be included with JRE [0-9]\+, JDK [0-9]\+, and OpenJDK [0-9]\+" || \
-      fail "'bazel_with_jdk license' did not print an expected string from THIRD_PARTY_README"
+      fail "'bazel license' did not print an expected string from THIRD_PARTY_README"
 }
 
-run_suite "bazel_with_jdk test suite"
+run_suite "bazel test suite"
diff --git a/src/test/shell/bin/bazel b/src/test/shell/bin/bazel
index 975d4df..3a77cb3 100755
--- a/src/test/shell/bin/bazel
+++ b/src/test/shell/bin/bazel
@@ -17,4 +17,4 @@
 # Wrapper script to run bazel in the tests. Any change to this file will
 # affect all our integration tests.
 #
-exec $(rlocation io_bazel/src/bazel_with_jdk) --bazelrc=$TEST_TMPDIR/bazelrc "$@"
+exec $(rlocation io_bazel/src/bazel) --bazelrc=$TEST_TMPDIR/bazelrc "$@"
diff --git a/src/test/shell/testenv.sh b/src/test/shell/testenv.sh
index d1a2dd3..1f31aac 100755
--- a/src/test/shell/testenv.sh
+++ b/src/test/shell/testenv.sh
@@ -60,7 +60,7 @@
 fi
 
 # Make the command "bazel" available for tests.
-PATH_TO_BAZEL_BIN=$(rlocation io_bazel/src/bazel_with_jdk)
+PATH_TO_BAZEL_BIN=$(rlocation io_bazel/src/bazel)
 PATH_TO_BAZEL_WRAPPER="$(dirname $(rlocation io_bazel/src/test/shell/bin/bazel))"
 # Convert PATH_TO_BAZEL_WRAPPER to Unix path style on Windows, because it will be
 # added into PATH. There's problem if PATH=C:/msys64/usr/bin:/usr/local,