Njol / Skript

Skript is a Bukkit plugin which allows server admins to customize their server easily, but without the hassle of programming a plugin or asking/paying someone to program a plugin for them.
http://njol.ch/projects/skript
104 stars 65 forks source link

Broken when running with Java 6 #355

Open keir-nellyer opened 9 years ago

keir-nellyer commented 9 years ago

First of all I would like to say I am not personally a user of Skript, however a friend of mine had this issue and I was able to figure out why it is happening.

You use Java 7 features for example here: https://github.com/Njol/Skript/blob/master/src/main/java/ch/njol/skript/config/ConfigReader.java#L28 The NIO package is new in Java 7.

However due to your Maven configuration, the MANIFEST included in your plugins says it's compatible with Java 6.

There are 2 ways you could fix this:

A) Remove all references to Java 7 specific features and set this line https://github.com/Njol/Skript/blob/master/pom.xml#L226 to "1.6" which will throw an error when compiling if you attempt to use Java 7 specific features in the project.

B) Set https://github.com/Njol/Skript/blob/master/pom.xml#L226 and https://github.com/Njol/Skript/blob/master/pom.xml#L225 to "1.7" which will throw an error when Bukkit attempts to load the plugin if the user has a lower Java version than 1.7.

I would personally recommend option B.

Njol commented 9 years ago

I actually try to make Skript compatible with Java 6 and later, but still use some useful Java 7 features like native file copying. I don't know how to find uses of 1.7 API in my code though so I cannot guarantee that it works in Java 6, but most likely does.

BTW: java.nio.Charset was added in Java 1.4.