Skip to main content

jdk build instructions

9 replies [Last post]
pepe
Offline
Joined: 2003-06-10

Hello.
I'm having hard times in installing a configuration that will enable me to compile j2se. As i have no VC license, i'm preparing a linux install.
Is it me, or do the linux build instruction are pretty outdated and use long time deprecated/stopped/lost things?
For example, egcs... i've looked everywhere i could to get something to install, to no avail.
Oh, and the RedHAt advanced server 2.1... it's been released in 2002. i would even be happy to install it, if possible. Maybe a redhat7.2 would do the trick ?

I, of course, have to admit that i'm no linux guru but why is it such a pain?
Anyway, if anyone succeeded in installing and compiling please share your experience.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
pepe
Offline
Joined: 2003-06-10

Thanks for your tips and advice. I'll test all that tomorrow morning and hopefully that will be enough for me to progress to compilation stage.

What bothers me in that process is the high entry barrier. Compiling for windows requires (much) money to get a visualC++ (700€ VAT included). Compiling for linux is mhhh... technical, at least for me. It's not that i'm a linux newbie, i have my own linux server that i installed and configured, but the requirements are sometimes a bit weird. (i won't try to explain the reaction of people i questionned when begging for help on finding a rh2.1 and egcs... :/ )
On top of that is a little fact. What i have to submit is pretty easy and i think that in my wildest dreams i might even submit a working source without compiling it. And i'm getting blocked on my 'easy job' by something that makes it take hundred time i expected it to take. I'll be trying hard, again and again, with the time left i still have. I'm not rejecting a fault on you or anyone else. It's just that i have a bad habit in doing things that can seem easy, often turn to be, but i always get blocked by something i didn't expect, in a field that ought not to cause problems.
Bah.. Enough whining. As we say here, "c'est la vie"...

trembovetski
Offline
Joined: 2003-12-31

This has been mentioned before, but if your fix doesn't touch native code, you can modify the java source, compile and test with existing jdk by prepending the boot class path (-Xbootclasspath/p:
)

Thanks,
Dmitri

pepe
Offline
Joined: 2003-06-10

my plan was to first implement a subset of http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5094232
, that is ADD then the rest. ADD ought to be quick to implement as everything is already there in your code. Therefore, i need to compile native.
But...

pepe
Offline
Joined: 2003-06-10

Hello.
Did anyone succeed in installing a compilation environment for the JDK in a fresh linux? Something reproductible?
To my despair, i can't use the instructions given with the jdk to produce anything working.
I'm actually looking in doing anything necessary (that does not involve money) to at least compile j2se.
Thanks for any help.

kellyohair
Offline
Joined: 2004-09-03

I would think that a newer Linux should have a new enough gcc that it should work. What does gcc --version say on the Linux?

Excluding the building of the plugins of course (use BUILD_DEPLOY=false).

I'm guessing, but I think as long as the gcc/g++ compiler is relatively new and stable, this should build. Hotspot is more sensitive to the gcc/g++ stability, so you could try BUILD_HOTSPOT=false and try just building the j2se directory.

-kto

m_r_atkinson
Offline
Joined: 2003-08-29

I see the solution to the .gif problem is in http://forums.java.net/jive/thread.jspa?threadID=627&messageID=14791

Note the double slash is still required for ALT_BOOTDIR

I'm out tonight, so will report more on tuesday.

chaat
Offline
Joined: 2006-05-19

Pepe,

have you tried using the free 2003 or 2005 Express Edition compilers which can be downloaded for free.

http://msdn.microsoft.com/visualc/vctoolkit2003/

Good Luck,

Chuck H.

Message was edited by: chaat

kellyohair
Offline
Joined: 2004-09-03

When we start this Java SE Snapshots issue we chose Windows as the platform to make build machine setup easier and building easier.
Although I think we have improved things, there are always more things we can do, and we will continue this work.

We didn't target Linux at first, but we will be in the future, it's #2 on our list. But Linux is difficult due to the various releases being so different with libraries and compilers.

The JDK should build on various flavors of Linux, but this is extremely impossible for us to police and verify, so we will need to rely on help from the JDK community in making sure we build with as many Linux versions as possible.
When we do official builds, we are more particular, and this is to allow the built bits to run on the largest set of Linux installations.
But as a developer, you can be more flexible here, just remember that what you build might not be maximally portable, but if it is, let us know, perhaps we picked the wrong 'lowest common denominator' Linux build platform. ;^)

The plugins (deploy directory) is problematic due to the C++ interfaces and needing to match pretty closely the C++ compiler used to build the browers. But if you are willing to skip the deploy building (BUILD_DEPLOY=false), things should be easier. Not building the deploy/plugins also removes the need for some of the build machine setup like OJI, Mozilla headers, etc.

The hotspot build is C++, but since the hotspot VM doesn't expose C++ interfaces, it's less of an issue with the C++ runtime as it is with just getting a pot full of C++ code to compile successfully.
The hotspot C++ code should compile warning free, and if anyone sees warnings (that are valid warnings) please post them so they can be addressed.

Older versions of gcc/g++ will be a problem, and we won't be addressing build issues where an ancient gcc/g++ is being used, the one we use is ancient enough. ;^)
But more likely you will be using a newer gcc/g++, probably gcc/g++ 4?
In anycase, we should build with gcc/g++ 4, as long as have an up-to-date and fairly stable version.
Of course you could skip building hotspot entirely if you have a downloaded binary install available (BUILD_HOTSPOT=false ALT_JDK_IMPORT_PATH=/.../jdk1.6.0).
That way the pre-built libjvm.so is used in your build rather than building it from scratch.

If you run into problems, please post the problems, we will try and address them as best we can. But be patient with us because we likely will not have access to the exact same version of Linux and gcc/g++ as you.

In most cases you should be able to just use the GNU 'make' on the Linux system, and the 'zip' and 'unzip' too.
The Motif headers and sources needed is provided, so that
shouldn't be an issue.

Hope this helps. And if you have ideas, problems, ro just comments, please speak up, we need to hear it.

-kto

trembovetski
Offline
Joined: 2003-12-31

I think this reply should go onto someone's blog...
Who might that someone be... Hmm.. =)

Dmitri