使用 ical4j.jar Java 时出错



我想使用 ical4j 来向用户发送事件。当我执行此代码时:

    CompatibilityHints.setHintEnabled(CompatibilityHints.KEY_RELAXED_UNFOLDING, true);
    // Create a TimeZone
    TimeZoneRegistry registry = TimeZoneRegistryFactory.getInstance().createRegistry();
    TimeZone timezone = registry.getTimeZone("Europe/Paris");
    VTimeZone tz = timezone.getVTimeZone();

我收到此错误;

Exception in thread "main" java.lang.NoClassDefFoundError: edu/emory/mathcs/backport/java/util/concurrent/ConcurrentHashMap
at net.fortuna.ical4j.util.CompatibilityHints.<clinit>(CompatibilityHints.java:85)
at net.fortuna.ical4j.model.Iso8601.<init>(Iso8601.java:78)
at net.fortuna.ical4j.model.Date.<init>(Date.java:133)
at net.fortuna.ical4j.model.DateTime.<init>(DateTime.java:244)
at jconge_batches.TestCalendar.main(TestCalendar.java:106)
    Caused by: java.lang.ClassNotFoundException:       edu.emory.mathcs.backport.java.util.concurrent.ConcurrentHashMap
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 5 more

我在我的类路径中添加了 ical4j.jar。

如何解决此错误?

以下是 ica4j 1.x 所需的库:

  • backport-util-concurrent.jar
  • 共享编解码器.jar
  • 共享资源-io.jar
  • 下议院朗.jar
  • 共享资源日志记录.jar
  • 朱尼特.jar

commons-io和junit只需要单元测试。

相关内容

  • 没有找到相关文章

最新更新