[ERROR] [system.err] Error: Could not find or load main class Corporation


(Klaus Christiansen) #1

I get a error that I don’t understand.
[ERROR] [system.err] Error: Could not find or load main class Corporation
I don’t use any class called Corporation.
I’m using Gradle 4.9, and Java 10, Windows 10.
I get the error during test.

test {
    testLogging {
        showStandardStreams = true
    }
    options {
        systemProperties(System.getProperties())
    }

    include 'org/kec/db/test/AllTests.class'
}

17:14:23.627 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on cache directory workerMain (C:\Users\klaus\.gradle\caches\4.9\workerMain). 17:14:23.627 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on cache directory workerMain (C:\Users\klaus\.gradle\caches\4.9\workerMain). 17:14:23.627 [DEBUG] [org.gradle.process.internal.worker.child.WorkerProcessClassPathProvider] Using worker process classpath: [C:\Users\klaus\.gradle\caches\4.9\workerMain\gradle-worker.jar] 17:14:23.643 [DEBUG] [org.gradle.process.internal.health.memory.MemoryManager] There is no current snapshot of OS memory available - memory cannot be freed until a new memory status update occurs 17:14:23.644 [INFO] [org.gradle.process.internal.DefaultExecHandle] Starting process 'Gradle Test Executor 1'. Working directory: C:\Users\klaus\git\DatabaseConnector Command: C:\Program Files\Java\jdk-10.0.1\bin\java.exe -Dawt.toolkit=sun.awt.windows.WToolkit -Dfile.encoding.pkg=sun.io -Dfile.separator=\ -Djava.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment -Djava.awt.printerjob=sun.awt.windows.WPrinterJob -Djava.class.path=C:\Users\klaus\.gradle\wrapper\dists\gradle-4.9-bin\e9cinqnqvph59rr7g70qubb4t\gradle-4.9\lib\gradle-launcher-4.9.jar -Djava.class.version=54.0 -Djava.home=C:\Program Files\Java\jdk-10.0.1 -Djava.library.path=C:\Program Files\Java\jdk-10.0.1\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Program Files\Java\jdk-10.0.1\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\gradle-4.7\bin;C:\Program Files\PuTTY\;C:\Program Files (x86)\Skype\Phone\;C:\Program Files\SlikSvn\bin;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Users\klaus\AppData\Local\Microsoft\WindowsApps;C:\Users\klaus\AppData\Local\GitHubDesktop\bin;%USERPROFILE%\AppData\Local\Microsoft\WindowsApps;;. -Djava.runtime.name=Java(TM) SE Runtime Environment -Djava.runtime.version=10.0.1+10 -Djava.specification.name=Java Platform API Specification -Djava.specification.vendor=Oracle Corporation -Djava.specification.version=10 -Djava.vendor=Oracle Corporation -Djava.vendor.url=http://java.oracle.com/ -Djava.vendor.url.bug=http://bugreport.java.com/bugreport/ -Djava.vendor.version=18.3 -Djava.version=10.0.1 -Djava.version.date=2018-04-17 -Djava.vm.compressedOopsMode=Zero based -Djava.vm.info=mixed mode -Djava.vm.name=Java HotSpot(TM) 64-Bit Server VM -Djava.vm.specification.name=Java Virtual Machine Specification -Djava.vm.specification.vendor=Oracle Corporation -Djava.vm.specification.version=10 -Djava.vm.vendor="Oracle Corporation" -Djava.vm.version=10.0.1+10 -Djdk.debug=release -Dlibrary.jansi.path=C:\Users\klaus\.gradle\native\jansi\1.14\windows64 -Dline.separator= -Dorg.gradle.appname=gradlew -Dorg.gradle.native=false -Dos.arch=amd64 -Dos.name=Windows 10 -Dos.version=10.0 -Dpath.separator=; -Dsun.arch.data.model=64 -Dsun.boot.library.path=C:\Program Files\Java\jdk-10.0.1\bin -Dsun.cpu.endian=little -Dsun.cpu.isalist=amd64 -Dsun.desktop=windows -Dsun.io.unicode.encoding=UnicodeLittle -Dsun.java.command=org.gradle.launcher.daemon.bootstrap.GradleDaemon 4.9 -Dsun.java.launcher=SUN_STANDARD -Dsun.jnu.encoding=Cp1252 -Dsun.management.compiler=HotSpot 64-Bit Tiered Compilers -Dsun.os.patch.level -Duser.country.format=DK -Duser.dir=C:\Users\klaus\git\DatabaseConnector -Duser.home=C:\Users\klaus -Duser.language.format=da -Duser.name=klaus -Duser.script -Duser.timezone=Europe/Paris -javaagent:build/tmp/expandedArchives/org.jacoco.agent-0.8.1.jar_8059ed6e1ab8b88aac5d9097fad847bb/jacocoagent.jar=destfile=build/jacoco/test.exec,append=true,inclnolocationclasses=false,dumponexit=true,output=file,jmx=false @C:\Users\klaus\AppData\Local\Temp\gradle-worker-classpath13555137752820157863txt -Dfile.encoding=Cp1252 -Djava.io.tmpdir=C:\Users\klaus\AppData\Local\Temp\ -Duser.country=GB -Duser.language=en -Duser.variant -ea worker.org.gradle.process.internal.worker.GradleWorkerMain 'Gradle Test Executor 1' 17:14:23.644 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Environment for process 'Gradle Test Executor 1': {USERDOMAIN_ROAMINGPROFILE=DESKTOP-CRV863K, PROCESSOR_LEVEL=23, SESSIONNAME=Console, ALLUSERSPROFILE=C:\ProgramData, PROCESSOR_ARCHITECTURE=AMD64, PSModulePath=C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules;C:\Program Files\Intel\;C:\Program Files\Intel\Wired Networking\, SystemDrive=C:, DIRNAME=C:\Users\klaus\git\DatabaseConnector\, USERNAME=klaus, CMD_LINE_ARGS=test -d, ProgramFiles(x86)=C:\Program Files (x86), APP_HOME=C:\Users\klaus\git\DatabaseConnector\, PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC, DriverData=C:\Windows\System32\Drivers\DriverData, ProgramData=C:\ProgramData, ProgramW6432=C:\Program Files, HOMEPATH=\Users\klaus, PROCESSOR_IDENTIFIER=AMD64 Family 23 Model 1 Stepping 1, AuthenticAMD, ProgramFiles=C:\Program Files, PUBLIC=C:\Users\Public, windir=C:\WINDOWS, =::=::\, _SKIP=2, LOCALAPPDATA=C:\Users\klaus\AppData\Local, USERDOMAIN=DESKTOP-CRV863K, LOGONSERVER=\\DESKTOP-CRV863K, JAVA_HOME=C:\Program Files\Java\jdk-10.0.1, PROMPT=$P$G, GRADLE_HOME=C:\Program Files\gradle-4.7, OneDrive=F:\OneDrive, =C:=C:\Users\klaus\git\DatabaseConnector, APPDATA=C:\Users\klaus\AppData\Roaming, JAVA_EXE=C:\Program Files\Java\jdk-10.0.1/bin/java.exe, CommonProgramFiles=C:\Program Files\Common Files, Path=C:\Program Files\Java\jdk-10.0.1\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\gradle-4.7\bin;C:\Program Files\PuTTY\;C:\Program Files (x86)\Skype\Phone\;C:\Program Files\SlikSvn\bin;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Users\klaus\AppData\Local\Microsoft\WindowsApps;C:\Users\klaus\AppData\Local\GitHubDesktop\bin;%USERPROFILE%\AppData\Local\Microsoft\WindowsApps;, OS=Windows_NT, COMPUTERNAME=DESKTOP-CRV863K, AMDRMPATH=C:\Program Files\AMD\RyzenMaster\, PROCESSOR_REVISION=0101, CLASSPATH=C:\Users\klaus\git\DatabaseConnector\\gradle\wrapper\gradle-wrapper.jar, CommonProgramW6432=C:\Program Files\Common Files, ComSpec=C:\WINDOWS\system32\cmd.exe, APP_BASE_NAME=gradlew, SystemRoot=C:\WINDOWS, TEMP=C:\Users\klaus\AppData\Local\Temp, HOMEDRIVE=C:, USERPROFILE=C:\Users\klaus, TMP=C:\Users\klaus\AppData\Local\Temp, CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files, NUMBER_OF_PROCESSORS=16} 17:14:23.644 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: STARTING 17:14:23.645 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Waiting until process started: Gradle Test Executor 1. 17:14:23.652 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: STARTED 17:14:23.652 [INFO] [org.gradle.process.internal.DefaultExecHandle] Successfully started process 'Gradle Test Executor 1' 17:14:23.653 [DEBUG] [org.gradle.process.internal.ExecHandleRunner] waiting until streams are handled... 17:14:23.813 [ERROR] [system.err] Error: Could not find or load main class Corporation 17:14:23.814 [ERROR] [system.err] Caused by: java.lang.ClassNotFoundException: Corporation 17:14:23.841 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: FAILED 17:14:23.841 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Process 'Gradle Test Executor 1' finished with exit value 1 (state: FAILED) 17:14:23.845 [DEBUG] [TestEventLogger] 17:14:23.845 [DEBUG] [TestEventLogger] Gradle Test Run :test PASSED 17:14:23.846 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Execute executeTests for :test' 17:14:23.846 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Execute executeTests for :test' completed 17:14:23.846 [DEBUG] [org.gradle.api.internal.changedetection.state.CacheBackedTaskHistoryRepository] Snapshotting property binResultsDir (OUTPUT) for task ':test' 17:14:23.850 [DEBUG] [org.gradle.api.internal.changedetection.state.CacheBackedTaskHistoryRepository] Snapshotting property jvmArgumentProviders.jacocoAgent$0.jacoco.destinationFile (OUTPUT) for task ':test' 17:14:23.851 [DEBUG] [org.gradle.api.internal.changedetection.state.CacheBackedTaskHistoryRepository] Snapshotting property reports.enabledReports.html.destination (OUTPUT) for task ':test' 17:14:23.851 [DEBUG] [org.gradle.api.internal.changedetection.state.CacheBackedTaskHistoryRepository] Snapshotting property reports.enabledReports.junitXml.destination (OUTPUT) for task ':test' 17:14:23.853 [DEBUG] [org.gradle.api.internal.changedetection.state.CacheBackedTaskHistoryRepository] Snapshotting property reports.html.destination (OUTPUT) for task ':test' 17:14:23.854 [DEBUG] [org.gradle.api.internal.changedetection.state.CacheBackedTaskHistoryRepository] Snapshotting property reports.junitXml.destination (OUTPUT) for task ':test' 17:14:23.855 [DEBUG] [org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter] Removed task artifact state for {} from context. 17:14:23.855 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ':test' 17:14:23.855 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Task :test' 17:14:23.855 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Task :test' completed 17:14:23.855 [INFO] [org.gradle.execution.taskgraph.DefaultTaskPlanExecutor] :test (Thread[Task worker for ':' Thread 6,5,main]) completed. Took 0.511 secs. 17:14:23.855 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Task worker for ':' Thread 6: released lock on : 17:14:23.855 [DEBUG] [org.gradle.internal.work.DefaultWorkerLeaseService] Worker lease root.1.31 completed (1 worker(s) in use) 17:14:27.851 [DEBUG] [org.gradle.process.internal.health.memory.MemoryManager] Emitting OS memory status event {Total: 17108467712, Free: 11441725440} 17:14:27.851 [DEBUG] [org.gradle.launcher.daemon.server.health.LowMemoryDaemonExpirationStrategy] Received memory status update: {Total: 17108467712, Free: 11441725440} 17:14:27.851 [DEBUG] [org.gradle.process.internal.health.memory.MemoryManager] Emitting JVM memory status event {Maximum: 1073741824, Committed: 268435456} 17:14:30.665 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] DaemonExpirationPeriodicCheck running 17:14:30.667 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry. 17:14:30.667 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry. 17:14:30.667 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry. 17:14:30.668 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry. 17:14:30.668 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry. 17:14:30.668 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.

If I go back to Java 8 it works fine.
Please help me understand what is going on.

Regards Klaus


(Klaus Christiansen) #2

It also works with Java 9.