ScriptCraft

ScriptCraft

14.6k Downloads

Can I use java libraries or something?

x13machine opened this issue ยท 6 comments

commented

I wanted to connect to a redis database. Would I be able to use java libraries or node.js modules?

commented

where would I put the .jar file for the redis library?

commented

I figured it out.

commented

In java to connect a redis database it would be new Jedis("localhost"); I did /js c=new java.Jedis('localhost') . It complained that jedis is an object.

commented

You should be able to use Java libraries if there are java bindings for redis.

commented

What java package does the Jedis class live in? The code should be something like:

/js var jedis = new redis.clients.jedis.Jedis('localhost')
commented

If you need to use redis (or any other Java library) , include the jar file in the classpath when starting the server.

java -cp redis.jar:spigotmc.jar -org.bukkit.craftbukkit.Main (or whichever Main class is used by spigotmc or CanaryMod)