New to Sponge, compilation error

So I am a well-read Bukkit programmer coming to Sponge, and I love what I’ve seen so far. By far, the most common thing people yell at me about is coding in Java 8 occasionally, since their servers use Java 7. And the documentation for Sponge says that it supports 6-8. But whenever I try to compile in 7, it gives me an error that the class Optional is only available by reference or something like that. Only in Java 8 does it seem to know what an Optional is. Am I missing something? What do?

Sponge only supports Java 8 now. As Minecraft has made the move to 8, Sponge will follow.

https://docs.spongepowered.org/en/server/getting-started/jre.html

2 Likes

Where did you see that Sponge supports Java 6-8? (We need to know so we can correct that).

SpongeAPI has been Java 8 required for a few months now, so you’d be best to use JDK 8 to work in development.

3 Likes

Also note that Java 6 and Java 7 both are outdated and don’t get any updates anymore.

2 Likes

I have found and fixed one mention of it on https://docs.spongepowered.org/en/server/management/plugins#common-problems

@pie_flavor can you confirm that is the location where you read it?

2 Likes

@Saladoc Yes, can confirm.

1 Like