1.8.8 Java Compatibility

Discussion in 'Spigot Plugin Development' started by FretziLetsPlay, Jun 16, 2021.

  1. Is it possible to run spigot 1.8 with java 16 and do the plugins work with this java version wich i have coded with JavaSE-1.8
     
  2. so it's not possible to run a network from 1.8 to 1.17?
     
  3. TheJavaHacker

    Supporter

    By technicality, you CAN do this. We've had a discussion on the Discord and it turns out that whilst it CAN be done, it SHOULDN'T.
     
  4. Yes this will work (but you shouldn't run such old unsupported server software). Java is backwards compatible, meaning that code compiled for older versions will still run on newer versions of the java runtime.
    The only exception is when you are running Spigot 1.13 and later, because since then Spigot contains a bytecode translation layer which can only support bytecode levels for java versions that were available at the time of that spigot release. But 1.12.2 and earlier versions of Spigot can run on any version of Java later than 8.

    Following the reasoning above the Spigot versions that support Java 16 are: Spigot 1.12 and earlier, Spigot 1.16.5 and Spigot 1.17. Spigot 1.13-1.16.4 unfortunately won't run on Java 16, because they contain built-in checks for the version of Java they are running on, even though that shouldn't matter. In my opinion this is a design flaw in Spigot. On the upside: Those versions DO support Java 11 which is still hella lot better than Java 8.

    This is just plain false.
     
    #4 Jannyboy11, Jun 16, 2021
    Last edited: Jun 16, 2021
    • Agree Agree x 5
  5. Strahan

    Benefactor

    My 1.8.8 server must be some Jesus magic miracle then, lol
    Code (Text):
    C:\Games\Minecraft\188>java --version
    java 16.0.1 2021-04-20
    Java(TM) SE Runtime Environment (build 16.0.1+9-24)
    Java HotSpot(TM) 64-Bit Server VM (build 16.0.1+9-24, mixed mode, sharing)

    C:\Games\Minecraft\188>java -Xmx4G -Xms4G -jar spigot.1.8.8.jar
    Loading libraries, please wait...
    [21:37:58 INFO]: Starting minecraft server version 1.8.8
    [21:37:58 INFO]: Loading properties
    [21:37:58 INFO]: Default game type: SURVIVAL
    [21:37:58 INFO]: This server is running CraftBukkit version git-Spigot-21fe707-e1ebe52 (MC: 1.8.8) (Implementing API version 1.8.8-R0.1-SNAPSHOT)
    [21:37:58 INFO]: Your platform does not provide complete low-level API for accessing direct buffers reliably. Unless explicitly requested, heap buffer will always be preferred to avoid potential system unstability.
    [21:37:58 INFO]: Debug logging is disabled
    [21:37:58 INFO]: Server Ping Player Sample Count: 12

    [21:37:58 INFO]: Using 4 threads for Netty based IO
    [21:37:58 INFO]: Generating keypair
    [21:37:58 INFO]: Starting Minecraft server on *:25565
    [21:37:58 INFO]: Using default channel type
    [21:37:58 INFO]: Set PluginClassLoader as parallel capable
    [21:37:58 INFO]: [PermissionsEx] Loading PermissionsEx v1.23.4
    [21:37:58 INFO]: [WorldEdit] Loading WorldEdit v6.1.9;caf0ad9
    [21:37:58 INFO]: [Essentials] Loading Essentials v2.17.1.0
    [21:37:58 INFO]: [EssentialsSpawn] Loading EssentialsSpawn v2.17.1.0
    [21:37:58 INFO]: [EssentialsChat] Loading EssentialsChat v2.17.1.0
    [21:37:58 INFO]: [WorldGuard] Loading WorldGuard v6.1.3-SNAPSHOT;c904242
    [21:37:58 INFO]: Preparing start region for level 0 (Seed: -978798942766649962)
    [21:37:59 INFO]: Preparing start region for level 1 (Seed: -978798942766649962)
    [21:38:00 INFO]: Preparing start region for level 2 (Seed: -978798942766649962)
    [21:38:00 INFO]: [PermissionsEx] Enabling PermissionsEx v1.23.4
    [21:38:00 INFO]: [PermissionsEx] Initializing file backend
    [21:38:00 INFO]: [PermissionsEx] Permissions file successfully reloaded
    [21:38:00 INFO]: [WorldEdit] Enabling WorldEdit v6.1.9;caf0ad9
    [21:38:00 INFO]: WEPIF: PermissionsEx detected! Using PermissionsEx for permissions.
    [21:38:00 INFO]: [WorldEdit] Using com.sk89q.worldedit.bukkit.adapter.impl.Spigot_v1_8_R3 as the Bukkit adapter
    [21:38:00 INFO]: [Essentials] Enabling Essentials v2.17.1.0
    [21:38:00 INFO]: Attempting to convert old kits in config.yml to new kits.yml
    [21:38:00 INFO]: No kits found to migrate.
    [21:38:00 INFO]: [Essentials] Using legacy item data provider as mob spawner provider.
    [21:38:00 INFO]: [Essentials] Using legacy item data provider as spawn egg provider.
    [21:38:00 INFO]: [Essentials] Using legacy potion meta provider as potion meta provider.
    [21:38:00 WARN]: [PermissionsEx] The updater could not find any files for the project id 31279
    [21:38:00 INFO]: Loaded 852 items from items.csv.
    [21:38:00 INFO]: Using locale en_US
    [21:38:00 INFO]: [Essentials] ServerListPingEvent: Spigot iterator API
    [21:38:00 INFO]: [Essentials] Starting Metrics. Opt-out using the global bStats config.
    [21:38:00 WARN]: [Essentials] Detected supported permissions plugin PermissionsEx without Vault installed.
    [21:38:00 WARN]: [Essentials] Features such as chat prefixes/suffixes and group-related functionality will not work until you install Vault.
    [21:38:00 INFO]: [Essentials] Using superperms-based permissions.
    [21:38:00 INFO]: [EssentialsSpawn] Enabling EssentialsSpawn v2.17.1.0
    [21:38:00 INFO]: [EssentialsChat] Enabling EssentialsChat v2.17.1.0
    [21:38:00 INFO]: [WorldGuard] Enabling WorldGuard v6.1.3-SNAPSHOT;c904242
    [21:38:01 INFO]: [WorldGuard] (world) TNT ignition is PERMITTED.
    [21:38:01 INFO]: [WorldGuard] (world) Lighters are PERMITTED.
    [21:38:01 INFO]: [WorldGuard] (world) Lava fire is blocked.
    [21:38:01 INFO]: [WorldGuard] (world) Fire spread is UNRESTRICTED.
    [21:38:01 INFO]: [WorldGuard] Loaded configuration for world 'world'
    [21:38:01 INFO]: [WorldGuard] (world_nether) TNT ignition is PERMITTED.
    [21:38:01 INFO]: [WorldGuard] (world_nether) Lighters are PERMITTED.
    [21:38:01 INFO]: [WorldGuard] (world_nether) Lava fire is blocked.
    [21:38:01 INFO]: [WorldGuard] (world_nether) Fire spread is UNRESTRICTED.
    [21:38:01 INFO]: [WorldGuard] Loaded configuration for world 'world_nether'
    [21:38:01 INFO]: [WorldGuard] (world_the_end) TNT ignition is PERMITTED.
    [21:38:01 INFO]: [WorldGuard] (world_the_end) Lighters are PERMITTED.
    [21:38:01 INFO]: [WorldGuard] (world_the_end) Lava fire is blocked.
    [21:38:01 INFO]: [WorldGuard] (world_the_end) Fire spread is UNRESTRICTED.
    [21:38:01 INFO]: [WorldGuard] Loaded configuration for world 'world_the_end'
    [21:38:01 INFO]: [WorldGuard] Loading region data...
    [21:38:01 INFO]: Server permissions file permissions.yml is empty, ignoring it
    [21:38:01 INFO]: Done (2.351s)! For help, type "help" or "?"
    [21:38:01 INFO]: Starting remote control listener
    [21:38:01 INFO]: RCON running on 0.0.0.0:25575
     
    • Funny Funny x 1
  6. TheJavaHacker

    Supporter

    All hail the almighty work of Jesus!
     
    • Funny Funny x 1
  7. Yes it's not a problem, as you can have more Java versions running your servers in the network at the same time. So it's possible to have both Java 8, 11 and 16 running side by side and then it's up to you which server in your network is started with what Java version.
     
  8. ok but 1.8 would also run on java 16?
     
  9. and does anyone know how to update to this version? xD
     
  10. Java is backward compatibility. It means you can run java 8 code on java 9 or more, like java 16. Some features may be removed in java 16, especially with reflection where deprecated features in java 8 are removed in java 14.

    To upgrade the java version of your code, you can setup your IDE to build with newer versions (you will have to install jdk obviously). To run a server with another java version, you can execute it using javaw.exe of another version, or simply change your default java version with a command prompt.

    Run java 16 compiled code with java 8 can theorically be possible, but you should avoid using it. Plugins with recent java 16 features woudn't run.
     
  11. ok and server sided. I'm using Debian 9.
     
  12. ok i did it but when i try to use spigot 1.8 on java 16 it causes an console error. How can i run multiple java versions on my network?
     
  13. Java 16 is a great time for developers to reconsider dropping support for grossly outdated versions.

    People on 1.8 that want to continue using that plugin can always use the outdated jars that still supported 1.16.5 and below.

    And those who are current and want bug fixes and new things, they can move forward with an upgrade and get the benefits of a 1.17+ jar with all the bells and whistles.
     
    • Like Like x 1
  14. ok but 1.8 is the best version for pvp and i also want to use 1.17
     
    • Funny Funny x 1
  15. "in your opinion"

    If someone is good at pvp, they should have no issue beating me in a pvp game in 1.17.0 then.
     
  16. Then install multiple java versions and in start script define the full path to the java executable instead of just "java"
     
    • Like Like x 1
  17. ok thank you i will try
     
  18. Strahan

    Benefactor

    Well, telling us "causes an console error" is not helpful. What is the error?