• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

How do they compile JDK?

 
Ranch Hand
Posts: 133
Hibernate Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A very naive question it may seem. But I have always wondered what would be the process to compile a JDK version.
I am unable to figure it out because there are various native language programs involved plus they have to create various JVM's for different platforms.
Any thoughts on how this gigantic task must be taking place? like which platform/OS they must be using?
 
Ranch Hand
Posts: 859
IBM DB2 Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The compiler itself, can actually be written in Java to run on a native JRE.

All the JDK does is generate bytecode from source files to be executed later.

You could in theory write javac in Cobol!

WP
 
lowercase baba
Posts: 13082
67
Chrome Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
a compiler does nothing more than take one file as input, and generates a new file as output.

I believe, the original compiler was written in C. that lets you build the javac and java executables.

Once you have those, you can write a java program. And one program you can write is...a java compiler. You may want to research the term "bootstrapping" as it relates to compilers.
 
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

rohit chavan wrote:Any thoughts on how this gigantic task must be taking place? like which platform/OS they must be using?


I suspect it's all pretty much automated by now. Probably some massive 'make'-like script that somebody wrote many moons ago, and gets updated for each major release - and don't forget that those only come out every blue moon.

As to platforms: Dunno exactly; but I suspect that Oracle inherited a pile of Solaris servers from Sun, and they probably have a few of their own for testing their database on various platforms - possibly even a few Linux servers now (although it didn't appear so back when I was having to deal with 8i).

What are the major platforms these days?
Windows (obviously); MAC of course; Unix - and how many commercial versions of that are there left? Solaris, HPUX, AIX, and maybe pure BSD. And then there's Linux - so: RedHat, Debian, Ubuntu, SuSE, and possibly Mandrake.
I can't imagine they try to cover all bases, just major kernel/version variants, and its highly likely that the underlying system calls don't actually change a lot from release to release.

A sizeable task, nevertheless; but don't forget that it only applies to the JVM itself. It's quite possible that the java and javac commands hardly change at all.

Winston
 
Sheriff
Posts: 17338
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Winston Gutkowski wrote:Probably some massive 'make'-like script that somebody wrote many moons ago, and gets updated for each major release - and don't forget that those only come out every blue moon.


So there's one coming out tonight? Or did they miss the memo?
 
Junilu Lacar
Sheriff
Posts: 17338
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here's some "light reading" on how they build OpenJDK: http://openjdk.java.net/groups/build/
 
rohit chavan
Ranch Hand
Posts: 133
Hibernate Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
After going through the links provided, I could see that JAVA is a self-hosting, programming language.
In the sens,e that a compiler for the language, can be written in that same language.

Thank you all for the responses.

- Rohit
 
Without deviation from the norm, progress is not possible - Zappa. Tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic