javapathfinder / jpf-core

JPF is an extensible software analysis framework for Java bytecode. jpf-core is the basis for all JPF projects; you always need to install it. It contains the basic VM and model checking infrastructure, and can be used to check for concurrency defects like deadlocks, and unhandled exceptions like NullPointerExceptions and AssertionErrors.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Failed

shadowasphodel2919 opened this issue · comments

I have been trying to build java-10-gradle on my Windows 10 OS.
With java version :
java version "11.0.9" 2020-10-20 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.9+7-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.9+7-LTS, mixed mode).
The site.properties file which I have added is

JPF site configuration

jpf-core = $D:\OpenSource\jpf-core
extensions=${jpf-core}

When I run
gradlew buildJars
this is output

Task :compileClassesJava FAILED
D:\OpenSource\jpf-core\src\classes\modules\java.base\jdk\internal\misc\SharedSecrets.java:53: error: cannot find symbol
private static JavaUtilJarAccess javaUtilJarAccess;
^
symbol: class JavaUtilJarAccess
location: class SharedSecrets
D:\OpenSource\jpf-core\src\classes\modules\java.base\jdk\internal\misc\SharedSecrets.java:55: error: cannot find symbol
private static JavaLangInvokeAccess javaLangInvokeAccess;
^
symbol: class JavaLangInvokeAccess
location: class SharedSecrets
D:\OpenSource\jpf-core\src\classes\modules\java.base\jdk\internal\misc\SharedSecrets.java:57: error: cannot find symbol
private static JavaNetURLAccess javaNetURLAccess;
^
symbol: class JavaNetURLAccess
location: class SharedSecrets
D:\OpenSource\jpf-core\src\classes\modules\java.base\jdk\internal\misc\SharedSecrets.java:63: error: cannot find symbol
private static JavaObjectInputStreamAccess javaObjectInputStreamAccess;
^
symbol: class JavaObjectInputStreamAccess
location: class SharedSecrets
D:\OpenSource\jpf-core\src\classes\modules\java.base\jdk\internal\misc\SharedSecrets.java:64: error: cannot find symbol
private static JavaObjectInputFilterAccess javaObjectInputFilterAccess;
^
symbol: class JavaObjectInputFilterAccess
location: class SharedSecrets
D:\OpenSource\jpf-core\src\classes\modules\java.base\jdk\internal\misc\SharedSecrets.java:75: error: cannot find symbol
public static void setJavaLangInvokeAccess(JavaLangInvokeAccess jlia) {
^
symbol: class JavaLangInvokeAccess
location: class SharedSecrets
D:\OpenSource\jpf-core\src\classes\modules\java.base\jdk\internal\misc\SharedSecrets.java:79: error: cannot find symbol
public static JavaLangInvokeAccess getJavaLangInvokeAccess() {
^
symbol: class JavaLangInvokeAccess
location: class SharedSecrets
D:\OpenSource\jpf-core\src\classes\modules\java.base\jdk\internal\misc\SharedSecrets.java:98: error: cannot find symbol
public static void setJavaNetURLAccess(JavaNetURLAccess jnua) {
^
symbol: class JavaNetURLAccess
location: class SharedSecrets
D:\OpenSource\jpf-core\src\classes\modules\java.base\jdk\internal\misc\SharedSecrets.java:102: error: cannot find symbol
public static JavaNetURLAccess getJavaNetURLAccess() {
^
symbol: class JavaNetURLAccess
location: class SharedSecrets
D:\OpenSource\jpf-core\src\classes\modules\java.base\jdk\internal\misc\SharedSecrets.java:108: error: cannot find symbol
public static JavaUtilJarAccess javaUtilJarAccess() {
^
symbol: class JavaUtilJarAccess
location: class SharedSecrets
D:\OpenSource\jpf-core\src\classes\modules\java.base\jdk\internal\misc\SharedSecrets.java:114: error: cannot find symbol
public static void setJavaUtilJarAccess(JavaUtilJarAccess access) {
^
symbol: class JavaUtilJarAccess
location: class SharedSecrets
D:\OpenSource\jpf-core\src\classes\modules\java.base\jdk\internal\misc\SharedSecrets.java:168: error: cannot find symbol
public static JavaObjectInputStreamAccess getJavaObjectInputStreamAccess() {
^
symbol: class JavaObjectInputStreamAccess
location: class SharedSecrets
D:\OpenSource\jpf-core\src\classes\modules\java.base\jdk\internal\misc\SharedSecrets.java:177: error: cannot find symbol
public static void setJavaObjectInputStreamAccess(JavaObjectInputStreamAccess access) {
^
symbol: class JavaObjectInputStreamAccess
location: class SharedSecrets
D:\OpenSource\jpf-core\src\classes\modules\java.base\jdk\internal\misc\SharedSecrets.java:181: error: cannot find symbol
public static JavaObjectInputFilterAccess getJavaObjectInputFilterAccess() {
^
symbol: class JavaObjectInputFilterAccess
location: class SharedSecrets
D:\OpenSource\jpf-core\src\classes\modules\java.base\jdk\internal\misc\SharedSecrets.java:188: error: cannot find symbol
public static void setJavaObjectInputFilterAccess(JavaObjectInputFilterAccess access) {
^
symbol: class JavaObjectInputFilterAccess
location: class SharedSecrets
15 errors

FAILURE: Build failed with an exception.

  • What went wrong:

Execution failed for task ':compileClassesJava'.

Compilation failed; see the compiler error output for details.

  • Try:

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

BUILD FAILED in 2s

4 actionable tasks: 1 executed, 3 up-to-date

I am running this test upon java-10-gradle branch.

I have also tried running gradlew clean check --stacktrace .
Check out this file for the errors.
gradlew clean check.txt

If anyone has anyone any solutions this do hit me up.

Hi @cyrille-artho there can i work on this issue? as a open source contributor

Hi,
These symbols are classes from the Java base library (as per Java 11). I think what happens is that gradle uses the wrong Java version for the build. Try to look into ways of troubleshooting gradle (how it finds and uses a given Java version).
The gradle version is the "right" one, as it's given by the wrapper ./gradlew. So something goes wrong when trying to use the correct version of Java.
Note that gradle does not use the same mechanism (classpath, JAVA_HOME, etc.) as the shell.

@cyrille-artho I tried to set the version dynamically using command line flags , system properties by adding a gradle.properties file and doing a little tinkering in build.gradle but none of it seems to work and the gradlew clean check command still gives the SharedSecrets errors.
gradlew -v gives


Gradle 5.4.1

Build time: 2019-04-26 08:14:42 UTC
Revision: 261d171646b36a6a28d5a19a69676cd098a4c19d

Kotlin: 1.3.21
Groovy: 2.5.4
Ant: Apache Ant(TM) version 1.9.13 compiled on July 10 2018
JVM: 11.0.9 (Oracle Corporation 11.0.9+7-LTS)
OS: Windows 10 10.0 amd64

@sumitdnath I would welcome your suggestions too.

Have you tried setting JAVA_HOME to the location of your JDK 11 installation? I'm not sure if Gradle gets its Java info from there, but it could be that the "JVM" entry shown here is just the JVM to run Gradle itself, and that in some cases, the compiler used to compile the files is different.
(It's not supposed to be, and build.gradle clearly states Java 11, but then again, the build fails for you for some reason...)

I have already changed it. echo %JAVA_HOME% gives

C:\Program Files\Java\jdk-11.0.9

I used to work on java 13 but I changed it the moment I pulled the project.

Check inside that location if you really have the complete installation. Perhaps some files are missing? Perhaps reinstalling Java 11 could help; if you don't use Java 11 for anything else, it might potentially be a broken installation without you otherwise noticing anything amiss.

@cyrille-artho It turns out your suggestion worked in a way. I had to install openJDK 11 instead of jdk 11.0.9 version I was using earlier.

i need to learn about open source contribution could anyone please help?