- Joined
- Aug 2, 2010
- Messages
- 190
- Reaction score
- 90
Since Java 7 support is ending in approximately a month and most users are switching over to Java 8, I felt like being nice and giving people a heads-up on how to easily migrate over to Java 8.
Generally speaking, code compatibility shouldn't break when you migrate from Java 7 to 8. The only exception are the NPC scripts in OdinMS. Unless you updated all your NPC scripts to be Nashorn compatible (Java 8 JS Standard), your NPC scripts are compatible only with Mozilla Rhino. Since JSR-223 essentially left Mozilla Rhino in the dust, Java 8 will no longer support your NPC scripts. If you're lazy like me and are unwilling to go through every NPC script and replace the JavaScript, I'd suggest doing the following.
JSR-223
Mozilla Rhino is still very well alive, it's just that Java 8 and later will never include it in the Runtime libraries. To fix this, you'll need the Mozilla Rhino engine which is attainable here:
You'll also need js.jar which can be extracted from this archive:
Lastly, in your engine factory you'll need to change "JavaScript" to "rhino". Once you make the changes, recompile and add the downloaded 2 jars to your classpath. You'll need to do this pretty much for Java 8 and later versions unless you decide to update all your NPC scripts to work with Nashorn instead.
JSR-310
If you're also like me, you probably used JODA Time for managing most of the date times in Java 7 since Java didn't have an effective Time API. This is now changed in Java 8 with the addition of java.time. I would personally suggest using java.time.ZonedDateTime in replacement for DateTime in JODA. Even the JODA time developers have encouraged use of the new time APIs.
That's all I have really done to support Java 8, let me know if it works out for you or if there should be additions.
Generally speaking, code compatibility shouldn't break when you migrate from Java 7 to 8. The only exception are the NPC scripts in OdinMS. Unless you updated all your NPC scripts to be Nashorn compatible (Java 8 JS Standard), your NPC scripts are compatible only with Mozilla Rhino. Since JSR-223 essentially left Mozilla Rhino in the dust, Java 8 will no longer support your NPC scripts. If you're lazy like me and are unwilling to go through every NPC script and replace the JavaScript, I'd suggest doing the following.
JSR-223
Mozilla Rhino is still very well alive, it's just that Java 8 and later will never include it in the Runtime libraries. To fix this, you'll need the Mozilla Rhino engine which is attainable here:
You must be registered to see links
You'll also need js.jar which can be extracted from this archive:
You must be registered to see links
Lastly, in your engine factory you'll need to change "JavaScript" to "rhino". Once you make the changes, recompile and add the downloaded 2 jars to your classpath. You'll need to do this pretty much for Java 8 and later versions unless you decide to update all your NPC scripts to work with Nashorn instead.
JSR-310
If you're also like me, you probably used JODA Time for managing most of the date times in Java 7 since Java didn't have an effective Time API. This is now changed in Java 8 with the addition of java.time. I would personally suggest using java.time.ZonedDateTime in replacement for DateTime in JODA. Even the JODA time developers have encouraged use of the new time APIs.
That's all I have really done to support Java 8, let me know if it works out for you or if there should be additions.