Alfresco SDK 4.0 build issue on Open JDK 11

cancel
Showing results for 
Search instead for 
Did you mean: 
nikhilesh_s1vak
Active Member II

Re: Alfresco SDK 4.0 build issue on Open JDK 11

Jump to solution

Hi @andrealigios,

Thanks for the swift response. Please find below inline comments for your questitons. 

  1. Can you please try running the Command Prompt as an Administrator?
    To do that, Right Click on the Command Prompt icon, then select Run as administrator:
    • Yes, i ran the command prompt as an administrator
  2. If it doesn't work, can you try:  dir > test.txt and see if it works?
    • It works and the dir info is written to the file.
    • But when i executed the java -version > test.txt, the file remains empty.
  3. If it still doesn't work, can you please try running it from Powershell?
    • Yeah i have tried in powershell but the result is same. image.png
  4. Apart from creating or not the output.txt file, can you try adding your custom code to this newly created all-in-one SDK-4.1 project, and see if you get the same error as before?
    • Sure i will do it and let you know the result. 
andrealigios
Alfresco Employee

Re: Alfresco SDK 4.0 build issue on Open JDK 11

Jump to solution

What if you do:

"java -version" > test.txt

?

Unluckily, I've no Windows here and cannot try it myself, but I suspect it's something like that...

nikhilesh_s1vak
Active Member II

Re: Alfresco SDK 4.0 build issue on Open JDK 11

Jump to solution

The command supposed to be as below:

java -version 2>output.txt

nikhilesh_s1vak
Active Member II

Re: Alfresco SDK 4.0 build issue on Open JDK 11

Jump to solution

Hi @andrealigios ,

The build was successfull with all in one archetype though i had issues with integration-tests. I have applied the enterprise license and verified the application. 

But when i run after adding the custom code the build fails throwing compilation errors. I am trying to import the project to Eclipse to understand the errors. But i think those issues are mostly the same issues which i was facing earlier. 

But i will update you soon once the import is successful. Kindly let me know how can i upload the output.txt file here?

andrealigios
Alfresco Employee

Re: Alfresco SDK 4.0 build issue on Open JDK 11

Jump to solution

You can use a service like https://pastebin.com/ , or even paste its content here in a code block, as you prefer.

nikhilesh_s1vak
Active Member II

Re: Alfresco SDK 4.0 build issue on Open JDK 11

Jump to solution

Hi @andrealigios 

Please find the below pastebin links of the output.txt response.

Before adding the custom code:

After adding the custom code:

 

nikhilesh_s1vak
Active Member II

Re: Alfresco SDK 4.0 build issue on Open JDK 11

Jump to solution

Hi @andrealigios ,

Did you get a chance to look into it?

andrealigios
Alfresco Employee

Re: Alfresco SDK 4.0 build issue on Open JDK 11

Jump to solution

Hi @nikhilesh_s1vak , yes I've had a look at it on Friday but then got very busy with the release of the new Alfresco SDK 4.2, which is almost ready.

Can you please tell me the exact version of Platform/Repo you're using (6.2.x.x)?

In Q4 2020, the Alfresco Platform has undergone a major structural refactoring, and your code might need to be revised in order to work against versions newer than November 2020.

Please provide me with this information, I'll have a look again at your log ASAP.

nikhilesh_s1vak
Active Member II

Re: Alfresco SDK 4.0 build issue on Open JDK 11

Jump to solution

Hi @andrealigios 

We are using Alfresco enterprise 6.2.0 version. 

andrealigios
Alfresco Employee

Re: Alfresco SDK 4.0 build issue on Open JDK 11

Jump to solution

I see your custom code is quite big since by default it compiles 128 files:

[INFO] Compiling 128 source files to C:\Nikhilesh\Work\Alfresco\alfresco 6.2\sdk-4.1\alfsdk41\alfsdk41-platform\target\classes


Unless the code is all related to a single functionality, I suggest you (as a golden rule) split it into smaller parts and start adding them one by one, testing when it stops working.

That said, the "Cannot find Symbol" error has several possible causes, but since we're talking about migrating from Java 8 or earlier to Java 9 or higher, which is where JPMS kicked in, you must probably just include a few libraries (and eventually refactor the imports with the help of your IDE, if they're changed) in the pom.xml.

 

Libraries that were included by default before and are not in the JDK anymore now.

For example, it happened to Java EE, and now if you need "javax" components you need to import them, eg.:

    <artifactId>javax.annotation-api</artifactId>

which in modern Java is not available by default.


While Maven simply complains, your IDE should also help you identify immediately what the problem is.

Please ensure that Eclipse (or IntelliJ CE) is properly configured to compile your project against Java 11 and not other versions, then take a look at all the red flags it should raise. 

At that point, it should really be a matter of identifying where the missing classes are gone in JDK11, and how to bring them back (likely by declaring them explicitly in pom.xml)

Please let me know if it helped.