Back

[Solved] Build Error on Java Functions

  • 0
  • Functions
palani
11 Oct, 2023, 15:34

Hi folks I am getting the below build error when I try to deploy a java function

Task :compileJava FAILED /usr/local/server/src/main/java/io/openruntimes/java/email-contact-form-demo/src/Main.java:5: error: package io.appwrite does not exist import io.appwrite.Client; ^ /usr/local/server/src/main/java/io/openruntimes/java/email-contact-form-demo/src/Utils.java:9: error: package jakarta.mail does not exist import jakarta.mail.MessagingException; ^ /usr/local/server/src/main/java/io/openruntimes/java/email-contact-form-demo/src/Utils.java:10: error: package jakarta.mail does not exist import jakarta.mail.Session; ^ /usr/local/server/src/main/java/io/openruntimes/java/email-contact-form-demo/src/Utils.java:11: error: package jakarta.mail does not exist import jakarta.mail.Transport; ^ /usr/local/server/src/main/java/io/openruntimes/java/email-contact-form-demo/src/Utils.java:12: error: package jakarta.mail.internet does not exist import jakarta.mail.internet.InternetAddress; ^ /usr/local/server/src/main/java/io/openruntimes/java/email-contact-form-demo/src/Utils.java:13: error: package jakarta.mail.internet does not exist import jakarta.mail.internet.MimeMessage;


My deps.gradle file

dependencies { implementation 'io.appwrite:sdk-for-kotlin:2.0.0' implementation 'com.sun.mail:jakarta.mail:2.0.0' }

I am using self hosted appwrite instance v1.4.3

java runtime 17

TL;DR
The user encountered a build error when deploying a Java function. The error message indicated that certain packages were not found. The user provided their `deps.gradle` file and mentioned that they were using a self-hosted Appwrite instance version 1.4.3 and Java runtime 17. Solution: It seems that the required packages are missing. To resolve this issue, the user should ensure that the appropriate dependencies are added to their `deps.gradle` file. They may need to update the version numbers or add the missing packages manually.
palani
11 Oct, 2023, 15:36

Hi @Steven can you please help

palani
11 Oct, 2023, 15:43

Hi @Danish can you help here please

D5
11 Oct, 2023, 15:55

Hello @palani please, avoid pinging people if it's not really needed 😅

D5
11 Oct, 2023, 15:56

Seems like it was not possible to get the packages located at such directories

D5
11 Oct, 2023, 15:58

How are you deploying the functions?

palani
11 Oct, 2023, 16:02

Sorry

palani
11 Oct, 2023, 16:02

Via Console

palani
11 Oct, 2023, 16:03

Given the entry point as main

palani
12 Oct, 2023, 18:18

[Solved] Build Error on Java Functions

D5
12 Oct, 2023, 19:20

Sooo... What's the solution?

D5
12 Oct, 2023, 19:20

Deploying throght any alternative method?

palani
12 Oct, 2023, 19:28

Yeah deployed it via cli

D5
12 Oct, 2023, 19:30

I see, glad to hear you managed to solve it 😄 . Sorry for not replying before, I lost the post between many others😓

palani
12 Oct, 2023, 19:33

No problem.i get it..

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more