cafebabe?

by Shashank Tiwari

We all know of "cafebabe", the magic number that identifies java executable file formats, and the discussions around its very existence which has shown up time and again on various groups including on comp.lang.java. However, what we don't know is if this was indeed the reason for the very name "Java"? (Java was supposed to be "Oak" till the lawyers feared that there was a possible conflict). Were the baristas really so charming that they inspired the developers to name their very language in their honor? Or is it that 0xCAFEBABE sounded more decent than "oxAFABCAFE", "oxCAFEFACE" or "oxABADCAFE" or cooler than "oxCoFFEE". (Assuming that they were trying to get a 32 bit combination that sounded like a sensible word or phrase!). Also, Mac (thus Mac OSX in Apple) has the magic word "cafebabe" too. Does this mean that baristas have a much deeper impact on software development than we know of :)

BTW, what do you think will happen if a Mac fat file was given to a JVM to execute? Will it get confused because of the "oxCAFEBABE" ?

5 Comments

Phil
2007-01-10 14:25:19
This gave me a good laugh. I haven't heard of this before today; the best one I ever had show up in a project, however, was a reference to 0xFEEDFACE in the debugger.


Sounds like Eclipse was hungry...

haxie
2007-01-10 15:59:40
All the dev guys i know like to work in Starbucks for the coffee and the view - most of the guys are in there so much that the baristas know what they want before they order... maybe gives the charming cafebabe idea legs?
Arien
2007-01-10 19:58:10
CAFEBABE was lovingly chosen after the baristas at Peet's in Palo Alto. Named before the Java name was chosen. Common lore back in the dark ages when Java was young.
Ivo Limmen
2007-01-10 23:29:09
'0xCAFEBABE' sounds a lot better than the the four letter hex code a virus once used to install itself into DOS 3: '0xDEAD' :D

2007-01-12 05:25:23
It's just of one of the many 32bit hex-combinations you can use to easily read memory to see if an address has been modified, 0xdeadbeef is usually used where the stack end to see if the stack has overflowed. Programmers should have seen a lot of the different combinations used as human readable.