Thanks Julian but unfortunately it didn't worked:
I have already built oak-shaded-guava and everything other from command line,
anyway I've rebuilt oak-shaded-guava, in its target I have its jar 1.64.0, then
I have added the exclusion in the pom of my very very simple hello-world
project:
<dependencies>
<dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>oak-core</artifactId>
<version>1.64.0</version>
<exclusions>
<exclusion>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>oak-shaded-guava</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>oak-jcr</artifactId>
<version>1.64.0</version>
<exclusions>
<exclusion>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>oak-shaded-guava</artifactId>
</exclusion>
</exclusions>
</dependency>
but when I run it from Eclipse I have again same errors:
Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/jackrabbit/guava/common/base/Predicate
at
org.apache.jackrabbit.oak.plugins.memory.MemoryNodeStore.<init>(MemoryNodeStore.java:73)
at it.cegeka.oak.Hello.main(Hello.java:24)
Caused by: java.lang.ClassNotFoundException:
org.apache.jackrabbit.guava.common.base.Predicate
at
java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at
java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
... 2 more
if you have a working code built in eclipse could you share with me?
Cordiali saluti / Best regards,
Raffaele Gambelli
Senior Java Developer
E [email protected]<mailto:[email protected]>
[CEGEKA] Via Ettore Cristoni, 84
IT-40033 Bologna (IT), Italy
T +39 02 2544271
WWW.CEGEKA.COM<https://www.cegeka.com/>
[http://signature.cegeka.com/SignatureRO/bannerRO.jpg]
________________________________
From: Julian Reschke <[email protected]>
Sent: Monday, June 17, 2024 5:34 PM
To: [email protected] <[email protected]>
Subject: Re: The import org.apache.jackrabbit.guava cannot be resolved
[You don't often get email from [email protected]. Learn why this
is important at https://aka.ms/LearnAboutSenderIdentification ]
Am 17.06.2024 um 17:28 schrieb Raffaele Gambelli:
> Hi all,
>
> I would like to start exploring oak, I've imported full project in Eclipse
> STS but everywhere there is an import to org.apache.jackrabbit.guava I have
> errors.
Eclipse's Maven support doesn't understand the shade plugin, so
1) you need to build oak-shaded-guava with maven from the command line, and
2) *exclude* that module when you import the project (or remove it once
you imported "everything").
> I have this kind of problem even if I create an hello-world project depending
> on oak-core, when I run the application it says:
>
> Exception in thread "main" java.lang.NoClassDefFoundError:
> org/apache/jackrabbit/guava/common/base/Predicate
> at
> org.apache.jackrabbit.oak.plugins.memory.MemoryNodeStore.<init>(MemoryNodeStore.java:73)
> at it.cegeka.oak.Hello.main(Hello.java:15)
> Caused by: java.lang.ClassNotFoundException:
> org.apache.jackrabbit.guava.common.base.Predicate
> at
> java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
> at
> java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
> at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
> ... 2 more
>
> I cannot find any class named
> org.apache.jackrabbit.guava.common.base.Predicates, could you help me?
It's generated using the "shade" plugin within oak-shaded-guava.
> If I run mvn clean install or run my hello world main class from command line
> it works, but I would like run it in eclipse to debug.
>
> Thanks
>
> Cordiali saluti / Best regards,
>
> Raffaele Gambelli
> Senior Java Developer
> E [email protected]<mailto:[email protected]>
>
> [CEGEKA] Via Ettore Cristoni, 84
> IT-40033 Bologna (IT), Italy
> T +39 02 2544271
> https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.cegeka.com%2F&data=05%7C02%7CRaffaele.Gambelli%40cegeka.com%7C5e55ca311af24da0710508dc8ee2f7ff%7C42151053019347aa9e81effd81f772cc%7C0%7C0%7C638542352673171240%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=3DI9mpiNWerzNmK6yDbLqSaUydWPD%2FajbLEUWB9i3IM%3D&reserved=0<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.cegeka.com%2F&data=05%7C02%7CRaffaele.Gambelli%40cegeka.com%7C5e55ca311af24da0710508dc8ee2f7ff%7C42151053019347aa9e81effd81f772cc%7C0%7C0%7C638542352673179621%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=kGrPz8pkKQicmMiYhSfMHN5CVkma913UeUVUa34gOdo%3D&reserved=0><http://www.cegeka.com/>
>
> [https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fsignature.cegeka.com%2FSignatureRO%2FbannerRO.jpg&data=05%7C02%7CRaffaele.Gambelli%40cegeka.com%7C5e55ca311af24da0710508dc8ee2f7ff%7C42151053019347aa9e81effd81f772cc%7C0%7C0%7C638542352673185490%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=WW8rjYm86wytGOTMKar3At8mH52Xx1%2FiYBV8FqisGGc%3D&reserved=0<http://signature.cegeka.com/SignatureRO/bannerRO.jpg>]
Best regards, Julian