It sounds like you're talking about using Java to create a Virtual Machine. The JVM has to be hosted by an underlying OS. I don't think it's a practical approach, though I haven't thought about it...