Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support to compile task on Gradle with Java 10 #139

Closed
jeandersonbc opened this issue Aug 3, 2018 · 5 comments
Closed

Add support to compile task on Gradle with Java 10 #139

jeandersonbc opened this issue Aug 3, 2018 · 5 comments
Assignees

Comments

@jeandersonbc
Copy link
Collaborator

Related to #138

Currently unable to compile classes but I haven't added compile args at the moment.

@jeandersonbc jeandersonbc self-assigned this Aug 3, 2018
@jeandersonbc
Copy link
Collaborator Author

jeandersonbc commented Aug 3, 2018

@gayanW I was checking these changes for reference: #28

I made some progress regarding those "package ... is declared in module ... which does not export it to unanmed module)"-like errors but I hitting another compilation error:

/tmp/src/classes/gov/nasa/jpf/SerializationConstructor.java:23: error: cannot inherit from final Constructor
public class SerializationConstructor<T> extends Constructor<T> {
                                                 ^
/tmp/src/classes/gov/nasa/jpf/SerializationConstructor.java:23: error: constructor Constructor in class Constructor<T#2> cannot be applied to given types;
public class SerializationConstructor<T> extends Constructor<T> {
       ^
  required: Class<T#1>,Class<?>[],Class<?>[],int,int,String,byte[],byte[]
  found: no arguments
  reason: actual and formal argument lists differ in length
  where T#1,T#2 are type-variables:
    T#1 extends Object declared in class SerializationConstructor
    T#2 extends Object declared in class Constructor
2 errors

The class Constructor from src/classes/modules/java.base/java/lang/reflect/Constructor.java is right. Therefore, I'm guessing this error is happening because the module java.base has to be compiled first.

Did you have this error when you were doing this change?

(cc @cyrille-artho @wvisser)

@gayanW
Copy link
Collaborator

gayanW commented Aug 3, 2018

It is needed that we patch java.lang.reflect.Constructor with our MJI model class for Constructor, which is not final.

<compilerarg value="--patch-module"/>
<compilerarg value="java.base=src/classes/modules/java.base"/>

@jeandersonbc
Copy link
Collaborator Author

Great. I'm still getting how Jigsaw works but feels like we are in the right direction...

jeandersonbc added a commit that referenced this issue Aug 3, 2018
Also, I upgraded to the latest Gradle version (4.9).
@jeandersonbc
Copy link
Collaborator Author

jeandersonbc commented Aug 3, 2018

Still struggling to compile the modules on Gradle. I tried some alternatives from https://guides.gradle.org/building-java-9-modules but didn't work as expected.

It is like adding --patch-module doesn't have any effect.
I tried to compile the modules first but, again, it didn't work.
I need to debug the Gradle execution to understand what's happening because I'm able to compile the modules via command-line with the JDK only.

cyrille-artho pushed a commit that referenced this issue Jun 7, 2019
* Upgrade to gradle 5.4.1

* Add gradle task to compile modules.
@cyrille-artho
Copy link
Member

Resolved as part of PR#210.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants