1

I have a jhipster generated application using maven with java springboot on the backend. I want to add the ical4j library to the project so under the <dependencies> tag in the pom.xml file I added the lines like explained here . However when I add import org.mnode.ical4j; the maven compiler throws an error package org.mnode does not exist . This seems pretty trivial but I don't get what I am missing. Thank you

ErgiS
  • 223
  • 2
  • 10

1 Answers1

2

From what I can see in the official GitHub repo (ical4j/ical4j) the correct package to import starts from net.fortuna.ical4j. Example:

import net.fortuna.ical4j.util.DefaultEncoderFactory;
vicpermir
  • 3,544
  • 3
  • 22
  • 34
  • `net.fortuna` does not exist either. Also I imported `org.mnode` because of [this](https://stackoverflow.com/questions/49891232/difference-between-ical4j-libraries-org-mnode-ical4j-and-net-fortuna-ical4j) question – ErgiS Mar 10 '20 at 15:00
  • Interesting, I tested this before answering and I can use the library without issues with `net.fortuna.ical4j`. Have you run `mvn install` after changing the `pom.xml`? (so maven downloads everything needed) – vicpermir Mar 10 '20 at 15:21
  • I guess I'm missing something really basic. To test I cloned [this](https://github.com/spring-guides/gs-maven) git, in the initial folder added the dependency on the `pom.xml`, ran `mvn install`, added the import line on the `greeter.java` class and still have the error. – ErgiS Mar 11 '20 at 09:13
  • 1
    Ok so when I write `import net.fortuna.ical4j;` or `import net.fortuna.ical4j.*;` etc it doesn't compile but when I write it like you suggested `import net.fortuna.ical4j.util.DefaultEncoderFactory;` it works. Guess I need to look further into the docs. Thanks – ErgiS Mar 11 '20 at 09:19
  • Note that Java import wildcard only applies to classes. You can't use a wildcard to import all sub packages but rather must explicitly import the packages separately. – fortuna Mar 11 '20 at 10:12