Cannot build project (OD-818)
Closed
Miles Hill opened 2 years ago

I'd like to build and run the onedev on my machine but neither eclipse nor maven is able to build it. I followed the instructions here but eclipse gives me this error:

12:20:28 INFO  i.onedev.commons.bootstrap.Bootstrap - Launching application from '/Users/mileshill/Projects/onedev/server-product/target/sandbox'...
12:20:28 INFO  i.onedev.commons.bootstrap.Bootstrap - Cleaning temp directory...
12:20:29 INFO  io.onedev.commons.loader.AppLoader - Starting server...
java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:119)
	at java.base/java.lang.reflect.Method.invoke(Method.java:577)
	at io.onedev.commons.bootstrap.Bootstrap.main(Bootstrap.java:104)
Caused by: com.google.common.util.concurrent.ExecutionError: java.lang.ExceptionInInitializerError
	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2046)
	at com.google.common.cache.LocalCache.get(LocalCache.java:3850)
	at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3874)
	at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4799)
	at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4805)
	at com.google.inject.internal.FailableCache.get(FailableCache.java:51)
	at com.google.inject.internal.ConstructorInjectorStore.get(ConstructorInjectorStore.java:48)
	at com.google.inject.internal.ConstructorBindingImpl.initialize(ConstructorBindingImpl.java:155)
	at com.google.inject.internal.InjectorImpl.initializeBinding(InjectorImpl.java:581)
	at com.google.inject.internal.AbstractBindingProcessor$Processor$1.run(AbstractBindingProcessor.java:176)
	at com.google.inject.internal.ProcessedBindingData.initializeBindings(ProcessedBindingData.java:49)
	at com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:122)
	at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:106)
	at com.google.inject.Guice.createInjector(Guice.java:87)
	at com.google.inject.Guice.createInjector(Guice.java:69)
	at com.google.inject.Guice.createInjector(Guice.java:59)
	at io.onedev.commons.loader.AppLoader.start(AppLoader.java:65)
	at io.onedev.commons.bootstrap.Bootstrap.main(Bootstrap.java:189)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	... 2 more
Caused by: java.lang.ExceptionInInitializerError
	at com.google.inject.internal.ProxyFactory.<init>(ProxyFactory.java:87)
	at com.google.inject.internal.ConstructorInjectorStore.createConstructor(ConstructorInjectorStore.java:82)
	at com.google.inject.internal.ConstructorInjectorStore.access$000(ConstructorInjectorStore.java:29)
	at com.google.inject.internal.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:37)
	at com.google.inject.internal.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:33)
	at com.google.inject.internal.FailableCache$1.load(FailableCache.java:40)
	at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3444)
	at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2193)
	at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2152)
	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2042)
	... 20 more
Caused by: com.google.inject.internal.cglib.core.$CodeGenerationException: java.lang.reflect.InaccessibleObjectException-->Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @20b12f8a
	at com.google.inject.internal.cglib.core.$ReflectUtils.defineClass(ReflectUtils.java:464)
	at com.google.inject.internal.cglib.core.$AbstractClassGenerator.generate(AbstractClassGenerator.java:336)
	at com.google.inject.internal.cglib.core.$AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:93)
	at com.google.inject.internal.cglib.core.$AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:91)
	at com.google.inject.internal.cglib.core.internal.$LoadingCache$2.call(LoadingCache.java:54)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at com.google.inject.internal.cglib.core.internal.$LoadingCache.createEntry(LoadingCache.java:61)
	at com.google.inject.internal.cglib.core.internal.$LoadingCache.get(LoadingCache.java:34)
	at com.google.inject.internal.cglib.core.$AbstractClassGenerator$ClassLoaderData.get(AbstractClassGenerator.java:116)
	at com.google.inject.internal.cglib.core.$AbstractClassGenerator.create(AbstractClassGenerator.java:291)
	at com.google.inject.internal.cglib.core.$KeyFactory$Generator.create(KeyFactory.java:221)
	at com.google.inject.internal.cglib.core.$KeyFactory.create(KeyFactory.java:174)
	at com.google.inject.internal.cglib.core.$KeyFactory.create(KeyFactory.java:153)
	at com.google.inject.internal.cglib.proxy.$Enhancer.<clinit>(Enhancer.java:73)
	... 30 more
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @20b12f8a
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
	at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:200)
	at java.base/java.lang.reflect.Method.setAccessible(Method.java:194)
	at com.google.inject.internal.cglib.core.$ReflectUtils$1.run(ReflectUtils.java:61)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:569)
	at com.google.inject.internal.cglib.core.$ReflectUtils.<clinit>(ReflectUtils.java:52)
	at com.google.inject.internal.cglib.core.$KeyFactory$Generator.generateClass(KeyFactory.java:243)
	at com.google.inject.internal.cglib.core.$DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25)
	at com.google.inject.internal.cglib.core.$AbstractClassGenerator.generate(AbstractClassGenerator.java:329)
	... 42 more

I'm using OpenJDK 18.0.1 on macOS Monterey 12.2.

Many thanks

Miles Hill commented 2 years ago

Changed JDK to good old 1.8 and it worked.

Miles Hill changed state to 'Closed' 2 years ago
Previous Value Current Value
Open
Closed
Miles Hill commented 2 years ago

Used JDK 1.8

Robin Shen commented 2 years ago

Yes, OneDev has to be compiled with JDK 1.8 currently, although the compile result can run on JVM 18.

issue 1 of 1
Type
Build Failure
Priority
Normal
Assignee
Failed Build
No build specified
Issue Votes (0)
Watchers (4)
Reference
OD-818
Please wait...
Page is in error, reload to recover