# Using J/Link with Wolfram Programming Cloud

Is it possible to use J/Link in a Wolfram Programming Cloud notebook? I need it to load and use 3rd-party .jars.

• initial testing revealed that OnlineM lets you load JLink with Needs["JLink"], but then upon ReinstallJava[] the kernel quits. I've also seen that it uses Java 7 update 13, which is quite depressing, given that the current Java is Java 8 update 11 since Jul 15. I'd assume that CloudM uses the same as OnlineM, but haven't been able to test yet. – Andreas Lauschke Jul 25 '14 at 0:00

You can load Java in the cloud, in either the interactive web interface or in deployed code. (Some things are different about those environments.)

CloudEvaluate[
str = JavaNew["java.lang.String", "Hello, world!"];
JavaObjectToExpression[str]]


"Hello, world!"

As pointed out by Andreas Lauschke, ReinstallJava[] crashed the kernel in the programming cloud interface for me as well, but interestingly it does not crash here:

CloudEvaluate[
Needs@"JLink";
ReinstallJava[];
str=JavaNew["java.lang.String","Hello, world!"];
JavaObjectToExpression[str]]


But it does not appear you can load jars, or edit the Java classpath.

jar = BinaryReadList@"HelloWorld.jar";
With[{j = jar},
CloudEvaluate[
path = "jars/HelloWorld.jar";
CreateDirectory["jars"];
BinaryWrite[path, j];
Close[path];
Testhello[]*)]]
`