Hi,
I am new here, trying to see if this is a good service or not to use in our business. So I followed the java guide here: https://transloadit.com/docs/#java-sdk
I am basically stuck on creating an Assembly. I copied the exact same code, and filled the other required parameters (the key, secret, etc…). But the problem is I get an error when I run the code. the error is referring to the code in the transloadit SKD.
The error:
Exception in thread "main" java.lang.NoClassDefFoundError: io/tus/java/client/TusURLStore at com.transloadit.sdk.Transloadit.newAssembly(Transloadit.java:102) at util.Main.main(Main.java:17) Caused by: java.lang.ClassNotFoundException: io.tus.java.client.TusURLStore at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ... 2 more
The code:
public class Main {
public static void main(String[] args) {
Transloadit transloadit = new Transloadit("my key", "my secret");
Assembly assembly = transloadit.newAssembly(); //Line 17
Map<String, Object> stepOptions = new HashMap<>();
stepOptions.put("width", 75);
stepOptions.put("height", 75);
assembly.addStep("resize", "/image/resize", stepOptions);
assembly.addFile(new File("testing.png"));
// you can skip this part if you don't want to wait till the
// assembly is complete
assembly.setShouldWaitForCompletion(true);
try {
AssemblyResponse response = assembly.save();
System.out.println(response.getId());
System.out.println(response.getUrl());
System.out.println(response.json());
} catch (RequestException | LocalOperationException e) {
// handle exception here
}
}}
I am using java JDK 11, if that makes any difference…