Author Topic: Compiling OpenJDK  (Read 36932 times)

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2247
  • Karma: +170/-0
    • View Profile
Compiling OpenJDK
« on: April 02, 2023, 12:13:03 am »
Hey All,

Wondering if anyone has ever (other than Dmik!) been able to compile OpenJDK on OS/2? ie https://trac.netlabs.org/java

I haven't tried for some time, but had previously attemped to follow the instructions a https://trac.netlabs.org/java/browser/tags/ga5/README and not gotten very far.

It would be nice to at least get the current code compiling, which could then form a basis for how feasible it is to use this code to updated to a newer openjdk version.

Cheers,

Paul

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4987
  • Karma: +110/-1
    • View Profile
Re: Compiling OpenJDK
« Reply #1 on: April 02, 2023, 02:20:45 am »
Doesn't look simple, in particular finding "The contents of the j2sdk-image directory of the Windows build of OpenJDK6"
I think to go any newer would take more fixes in Odin. Wouldn't be surprised if newer GCC's have problems, just compiling Mozilla and getting a working optimized binary was quite a challenge with luckily lots of hints in Bugzilla for newer Firefox's.
I might give it a try at some point.

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2247
  • Karma: +170/-0
    • View Profile
Re: Compiling OpenJDK
« Reply #2 on: April 02, 2023, 02:27:50 am »
Well if nothing else, there is a b49 at https://github.com/openjdk/jdk6 (vs our current b27)

Edit: https://download.oracle.com/otn/java/jdk/6u45-b06/jdk-6u45-windows-i586.exe might help for the j2sdk-image directory
« Last Edit: April 02, 2023, 02:41:20 am by Paul Smedley »

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4943
  • Karma: +44/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Compiling OpenJDK
« Reply #3 on: April 08, 2023, 06:49:28 pm »
Hi Paul

I completely support the idea to see what can it be done with OpenJDK, but I don't know if it will be too much to this and the Qt 6 port at the same time.

Check if something can be done, and let us know how can we support you.

Regards
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4987
  • Karma: +110/-1
    • View Profile
Re: Compiling OpenJDK
« Reply #4 on: April 08, 2023, 08:03:12 pm »
Well if nothing else, there is a b49 at https://github.com/openjdk/jdk6 (vs our current b27)

Edit: https://download.oracle.com/otn/java/jdk/6u45-b06/jdk-6u45-windows-i586.exe might help for the j2sdk-image directory

I see Oracle wants a login to download that :( Anyone all ready have one?

Ibrahim Hakeem

  • Full Member
  • ***
  • Posts: 125
  • Karma: +5/-0
    • View Profile
Re: Compiling OpenJDK
« Reply #5 on: April 08, 2023, 08:52:56 pm »
Well if nothing else, there is a b49 at https://github.com/openjdk/jdk6 (vs our current b27)

Edit: https://download.oracle.com/otn/java/jdk/6u45-b06/jdk-6u45-windows-i586.exe might help for the j2sdk-image directory

I see Oracle wants a login to download that :( Anyone all ready have one?

Dave, I have sent you a PM.

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2247
  • Karma: +170/-0
    • View Profile
Re: Compiling OpenJDK
« Reply #6 on: April 08, 2023, 10:20:06 pm »
Well if nothing else, there is a b49 at https://github.com/openjdk/jdk6 (vs our current b27)

Edit: https://download.oracle.com/otn/java/jdk/6u45-b06/jdk-6u45-windows-i586.exe might help for the j2sdk-image directory

I see Oracle wants a login to download that :( Anyone all ready have one?
It was free to create an account...

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4987
  • Karma: +110/-1
    • View Profile
Re: Compiling OpenJDK
« Reply #7 on: April 09, 2023, 01:12:44 am »
Yes, I prefer not to create too many accounts, lose track of them and often results in spam. Anyways have it now.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4987
  • Karma: +110/-1
    • View Profile
Re: Compiling OpenJDK
« Reply #8 on: April 09, 2023, 09:15:17 pm »
Next problem is pulling odin/trunk. After messing around, this works, svn co https://svn.netlabs.org/repos/odin32/ sorta until,
Code: [Select]
A    odin32/tags/0.8.9/src/kernel32/directory.h
A    odin32/tags/0.8.9/src/riched32
svn: E175002: REPORT request on '/repos/odin32/!svn/me' failed
and checks out everything, trying for trunk to begin with results in a bad URL error, trunk is something else or such. Continuing on after cleaning the repository with svn up till the same error. Repeat for every tag.

Andy Willis

  • Sr. Member
  • ****
  • Posts: 307
  • Karma: +7/-0
    • View Profile
Re: Compiling OpenJDK
« Reply #9 on: April 09, 2023, 09:37:47 pm »
Next problem is pulling odin/trunk. After messing around, this works, svn co https://svn.netlabs.org/repos/odin32/ sorta until,
Code: [Select]
A    odin32/tags/0.8.9/src/kernel32/directory.h
A    odin32/tags/0.8.9/src/riched32
svn: E175002: REPORT request on '/repos/odin32/!svn/me' failed
and checks out everything, trying for trunk to begin with results in a bad URL error, trunk is something else or such. Continuing on after cleaning the repository with svn up till the same error. Repeat for every tag.
svn co https://svn.netlabs.org/repos/odin32/trunk/
worked here
edit:
you can do svn co https://svn.netlabs.org/repos/odin32/trunk/ .
the dot puts everthing in the current directory, without the dot, it puts it into a directory under the current directory - trunk.
« Last Edit: April 09, 2023, 09:39:32 pm by Andy Willis »

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4943
  • Karma: +44/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Compiling OpenJDK
« Reply #10 on: April 09, 2023, 09:45:35 pm »
FYI: If you want to create the Odin and OpenJDK github repositories, you can do it under the Netlabsorg organization.
https://github.com/netlabsorg

I think you have access the create new repos now.

Regards
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4987
  • Karma: +110/-1
    • View Profile
Re: Compiling OpenJDK
« Reply #11 on: April 10, 2023, 12:02:16 am »
Yes, my problem was already having a trunk directory.
Building Odin, I have no experience with. The Java Port readme says to configure with configure.cmd --use-oldlib. Guess run kmk -f Config.kmk and see what happens and how to set up the environment.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4987
  • Karma: +110/-1
    • View Profile
Re: Compiling OpenJDK
« Reply #12 on: April 10, 2023, 01:21:14 am »
Hmm, build of Odin dies with lots of errors like,
Code: [Select]
K:/work/odin/trunk/src/kernel32/console.cpp:1627:1: error: narrowing conversion
of '144' from 'int' to 'char' [-Wnarrowing]
K:/work/odin/trunk/src/kernel32/console.cpp:1627:1: error: narrowing conversion
of '128' from 'int' to 'char' [-Wnarrowing]

Thought CHAR was defined as 0..255, not 0..127. Use UCHAR? Or uCHAR?
« Last Edit: April 10, 2023, 01:23:10 am by Dave Yeo »

Andy Willis

  • Sr. Member
  • ****
  • Posts: 307
  • Karma: +7/-0
    • View Profile
Re: Compiling OpenJDK
« Reply #13 on: April 10, 2023, 01:47:50 am »
Hmm, build of Odin dies with lots of errors like,
Code: [Select]
K:/work/odin/trunk/src/kernel32/console.cpp:1627:1: error: narrowing conversion
of '144' from 'int' to 'char' [-Wnarrowing]
K:/work/odin/trunk/src/kernel32/console.cpp:1627:1: error: narrowing conversion
of '128' from 'int' to 'char' [-Wnarrowing]

Thought CHAR was defined as 0..255, not 0..127. Use UCHAR? Or uCHAR?

Probably a change in GCC since 4.9.2 where warnings are now errors.

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2247
  • Karma: +170/-0
    • View Profile
Re: Compiling OpenJDK
« Reply #14 on: April 10, 2023, 02:46:01 am »
FYI: If you want to create the Odin and OpenJDK github repositories, you can do it under the Netlabsorg organization.
https://github.com/netlabsorg

I think you have access the create new repos now.

I set an import going to https://github.com/netlabsorg/odin32 - looks like it's going to take a while.....