1
我想使用ical4j將事件發送給用戶。 當我執行此代碼:使用ical4j.jar時發生錯誤Java
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
我在我的classpath中添加了ical4j.jar。
我該如何解決這個錯誤?
我有一個問題,backport-util-concurrent.jar也必須添加到類路徑。 –