Maksim Melnik
Maksim Melnik

Reputation: 555

Building OpenJDK8 on Windows x64

so I am trying to compile openjdk8 from sources, but I am stuck at missing files problem in the end of compilation process...

Here is the software that I use:

Here are the manuals which I was reading from:

With all these guides I am able to let it compile, however during the Building Images - step , I get an error that some files are missing ( and they are indeed missing ) , which makes me think that something has gone wrong during the build...

There are several points where I afraid I might be doing something wrong...

Right now I use cygwin version 2.8. The openjdk configure script requires cygwin version >1.7 but fails to recognize that 2.8 is greater than 1.7 and throws me an error, so i've tweaked the script (made build work like 2 months ago)...

My configure command looks as follows:

./configure --disable-ccache --with-freetype=/cygdrive/c/freetype

Maybe I need more arguments here to make it work ( note that i've copied self compiled make executable to cygwin bin folder, so that i dont need to provide its location )

I would rather try Professional Trial version, but it cannot be found anywhere anymore... (except torrents...) I have a strong feeling that Express version is not suitable for openjdk build. I also get that error with missing ammintrin.h file, but it is easily resolved by creating the empty header file in the include folder of Visual Studio installation.

My basic procedure of building is:

  1. Install all the software above
  2. hg clone http://hg.openjdk.java.net/jdk8/jdk8
  3. ./get_source.sh
  4. ./configure --disable-ccache --with-freetype=/cygdrive/c/freetype`
  5. make clean images

However, here how it ends :

enter image description here

Does anyone have any clue of how to solve this?

Upvotes: 2

Views: 2471

Answers (2)

Nathan Strong
Nathan Strong

Reputation: 2400

I found the proper fix: using the Cygwin installer, downgrade Grep to 2.27, which properly ignores CRLF line endings.

  1. Run the Cygwin setup (e.g. setup-x86_64.exe)
  2. Advance through the setup wizard until you get to the package selection
  3. Choose "Full" from the View drop-down menu
  4. Type "grep" into the search field
  5. Click the icon in the New column until it shows a 2.x version (2.27 as of this writing)
  6. Click Next and then Finish.

I found myself in the same position as you, except in my case I need OpenJDK build to be repeatable, so "run make repeatedly until it finishes" wasn't an acceptable solution.

Through some experimenting, I found the root cause:

  • grep was failing because the file being processed had Windows line endings (CRLF)
  • The Windows line endings were due to the fact that the file is generated by a Java app (fixpaths) which emits platform-native line endings
  • Identifying fixpaths led me to an old OpenJDK e-mail thread, which reported that some users were having the same problem and fixed it by downgrading.

This gave me the idea to try downgrading grep. I did so, and it worked.

Upvotes: 1

Maksim Melnik
Maksim Melnik

Reputation: 555

So, after couple of days at this task my only approach was to ignore the errors with the missing files and continue extracting files... This resulted in still working jdk image, which i currently use. My guess is that the errors come frome Oracle boot jdk. Since i am compiling an openjdk, it cannot find oracleJDK files in its headers and thus produces errors.

So, if anyone also gets same errors a me, try to ignore the missing files error and continue the images build.

Upvotes: 1

Related Questions