aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/cpp/blaze.cc
diff options
context:
space:
mode:
authorGravatar cushon <cushon@google.com>2018-03-29 09:57:36 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-03-29 09:59:55 -0700
commitdbe1ed769d4c957d7b8aea2c9c92febfc26f022d (patch)
treec5a5592074a815e7327ff3ee3865a22dbf92bab1 /src/main/cpp/blaze.cc
parent6db5972b93ac1178a2ddee88c56342fc4dcd2c0a (diff)
Remove startup JVM version check
This was added during the JDK 7->8 transition to improve the diagnostic when an older-than-supported host_javabase was used. The version number handling doesn't work with JDK 9 (see [1]), and using Bazel binaries with a bundled host_javabase avoid the error entirely so the message is less important. [1] http://openjdk.java.net/jeps/223 PiperOrigin-RevId: 190944476
Diffstat (limited to 'src/main/cpp/blaze.cc')
-rw-r--r--src/main/cpp/blaze.cc32
1 files changed, 1 insertions, 31 deletions
diff --git a/src/main/cpp/blaze.cc b/src/main/cpp/blaze.cc
index 2a125381b1..eb555dee58 100644
--- a/src/main/cpp/blaze.cc
+++ b/src/main/cpp/blaze.cc
@@ -640,36 +640,6 @@ static void GoToWorkspace(const WorkspaceLayout *workspace_layout) {
}
}
-// Check the java version if a java version specification is bundled. On
-// success, returns the executable path of the java command.
-static void VerifyJavaVersionAndSetJvm() {
- string exe = globals->options->GetJvm();
-
- string version_spec_file = blaze_util::JoinPath(
- GetEmbeddedBinariesRoot(globals->options->install_base), "java.version");
- string version_spec = "";
- if (blaze_util::ReadFile(version_spec_file, &version_spec)) {
- blaze_util::StripWhitespace(&version_spec);
- // A version specification is given, get version of java.
- string jvm_version = GetJvmVersion(exe);
-
- // Compare that jvm_version is found and at least the one specified.
- if (jvm_version.empty()) {
- die(blaze_exit_code::LOCAL_ENVIRONMENTAL_ERROR,
- "Java version not detected while at least %s is needed.\n"
- "Please set JAVA_HOME.",
- version_spec.c_str());
- } else if (!CheckJavaVersionIsAtLeast(jvm_version, version_spec)) {
- die(blaze_exit_code::LOCAL_ENVIRONMENTAL_ERROR,
- "Java version is %s while at least %s is needed.\n"
- "Please set JAVA_HOME.",
- jvm_version.c_str(), version_spec.c_str());
- }
- }
-
- globals->jvm_path = exe;
-}
-
// Starts the Blaze server.
static int StartServer(const WorkspaceLayout *workspace_layout,
BlazeServerStartup **server_startup) {
@@ -1489,7 +1459,7 @@ int Main(int argc, const char *argv[], WorkspaceLayout *workspace_layout,
WarnFilesystemType(globals->options->output_base);
ExtractData(self_path);
- VerifyJavaVersionAndSetJvm();
+ globals->jvm_path = globals->options->GetJvm();
blaze_server->Connect();
EnsureCorrectRunningVersion(blaze_server);