mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-12-09 02:42:30 -05:00
Support and switch to Java 17 everywhere except CentOS 7 (#6190)
This commit is contained in:
@@ -51,7 +51,7 @@ class LavalinkSetupCommands(MixinMeta, metaclass=CompositeMetaClass):
|
||||
This command shouldn't need to be used most of the time, and is only useful if the host machine has conflicting Java versions.
|
||||
|
||||
If changing this make sure that the Java executable you set is supported by Audio.
|
||||
The current supported version is Java 11.
|
||||
The current supported versions are Java 17 and 11.
|
||||
|
||||
Enter nothing or "java" to reset it back to default.
|
||||
"""
|
||||
|
||||
@@ -83,7 +83,7 @@ DANGEROUS_COMMANDS = {
|
||||
"This command will change the executable path of Java, "
|
||||
"this is useful if you have multiple installations of Java and the default one is causing issues. "
|
||||
"Please don't change this unless you are certain that the Java version you are specifying is supported by Red. "
|
||||
"The default and supported version is currently Java 11."
|
||||
"The default and supported versions are currently Java 17 and 11."
|
||||
),
|
||||
"command_llset_heapsize": _(
|
||||
"This command will change the maximum RAM allocation for the managed Lavalink node, "
|
||||
|
||||
@@ -365,20 +365,19 @@ class ServerManager:
|
||||
raise UnsupportedJavaException(
|
||||
await replace_p_with_prefix(
|
||||
self.cog.bot,
|
||||
f"The managed Lavalink node requires Java 11 to run{extras};\n"
|
||||
"Either install version 11 and restart the bot or connect to an external Lavalink node "
|
||||
f"The managed Lavalink node requires Java 17 or 11 to run{extras};\n"
|
||||
"Either install version 17 (or 11) and restart the bot or connect to an external Lavalink node "
|
||||
"(https://docs.discord.red/en/stable/install_guides/index.html)\n"
|
||||
"If you already have Java 11 installed then then you will need to specify the executable path, "
|
||||
"use '[p]llset java' to set the correct Java 11 executable.",
|
||||
"If you already have Java 17 or 11 installed then then you will need to specify the executable path, "
|
||||
"use '[p]llset java' to set the correct Java 17 or 11 executable.",
|
||||
) # TODO: Replace with Audio docs when they are out
|
||||
)
|
||||
java_xms, java_xmx = list((await self._config.java.all()).values())
|
||||
match = re.match(r"^(\d+)([MG])$", java_xmx, flags=re.IGNORECASE)
|
||||
command_args = [
|
||||
self._java_exc,
|
||||
"-Djdk.tls.client.protocols=TLSv1.2",
|
||||
f"-Xms{java_xms}",
|
||||
]
|
||||
command_args = [self._java_exc]
|
||||
if self._java_version[0] < 12:
|
||||
command_args.append("-Djdk.tls.client.protocols=TLSv1.2")
|
||||
command_args.append(f"-Xms{java_xms}")
|
||||
meta = 0, None
|
||||
invalid = None
|
||||
if match and (
|
||||
@@ -408,7 +407,7 @@ class ServerManager:
|
||||
self._java_version = None
|
||||
else:
|
||||
self._java_version = await self._get_java_version()
|
||||
self._java_available = (11, 0) <= self._java_version < (12, 0)
|
||||
self._java_available = self._java_version[0] in (11, 17)
|
||||
self._java_exc = java_exec
|
||||
return self._java_available, self._java_version
|
||||
|
||||
|
||||
Reference in New Issue
Block a user