I realize this will very likely be a short thread, but it is a question that has been eating at me for a while.
I have just started taking a Java class (basic introduction) and so far I am loving it. Primarily I am a web programmer, so the only difficult thing was the name changes for a few things.
So on to the question/explanation. I read somewhere that the android operating system is based on a Linux kernel and it has some C or C# in there and it largely utilizes Java for it's interface and control of the apps. So the question is:
Is it possible to create an OS based on a Linux kernel (like android) but completely out of Java (riding on the kernel) that would work on a desktop computer and allow you to open windows, mac, and linux programs? Like I said, I am a complete noob to this field, so be gentle with me.
Thanks in advance for your time and wisdom. =)

Hmm... Well, could you run Java without its interpretor? I doubt it because Java is not that low level language...

Hmm well i have to agree with Taywin since java is in a "virtual machine" meaning that the Operating system is in the lowest level, and the virtual machine also gives you certain amount of ram unlike C , like if you create a recursive program it will eventually run out of ram and quit without completing quitting your computer. As a full OS like MAC or Windows or Linux but you might be able to create a "webOS" .

I see. I thought it might be impossible, but you never know. I'm just itching to make something that could operate off three system's programs and still be very fast and stable. Guess that's not much of a reality is it?

Yes. It is quite possible. In fact, it's been done several times.

See: http://en.wikipedia.org/wiki/JavaOS

As a practical matter, it can't be 100% Java. There needs to be some kind of bootstrap or microkernel for the lowest level stuff to build upon. But one can make an operating system that is nearly all Java. (Well hey; Unix/Linux is/was *mostly* C.)

Java is a sandbox environment lanugage.It will not allow you to access out of the box.
You will definitely end up with using some other language like C or C++.

Ok. I'll give you a simple example..

Can you can develop a simple keylogger entirely in pure java ?
If you say yes , then the answer for your question is also yes..

Yeah. Java wasnt meant to do certain low level stuff. Thats why you will find plenty of Java API methods written in native code.

Besides why would one want a JavaOS? I see no BIG advantage with such an OS. But what we can have is a Java middleware...

Ah, Thank you JeffGrigg. That is very interesting. Does anyone know why they stopped work on JavaOS and switched to Java ME?

Harinath 2007, I'm not quite sure I understand that last part.... Sorry for being dumb.

stevanity, I guess my question shouldn't be so much just about Java. It is a language I am just starting to learn, so I was curious. But the purpose behind the question is really this: Is there a way to create a single OS, no matter how large, that can dependably and stably open, linux, windows, and mac programs without having to switch OS's?

If you just wanted to test it out you could make a desktop os like running XP in a VM. It would involve all of the difficulties of making it boot up os, but it would still be impressive. Then later you would only need to make minor changes to make it boot up.

Everyone gave up on Java ME, and moved on to the Dalvik VM on Android.

>;->

@sirlink99:
You can run Java on all those platforms.

Another way to make code run on all those platforms is to write code that is Posix compliant. It happens that all those platforms are Posix compliant.

Making an OS that reliably emulates all versions of all other OSs out there would be wildly impractical.

As a practical matter, it can't be 100% Java. There needs to be some kind of bootstrap or microkernel for the lowest level stuff to build upon. But one can make an operating system that is nearly all Java. (Well hey; Unix/Linux is/was *mostly* C.)

wrong. It can be done if you pick or design the right hardware (effectively you'd be implementing the JVM microkernel in hardware, this has been done) :)

Everyone gave up on Java ME, and moved on to the Dalvik VM on Android.

The necessity for JME pretty much evaporated on the mobile phone market as phones got more powerful to the point where they can now run full JSE virtual machines, not because Google came out with Android.

There's still a niche market for JME on things like pagers and smartcards.

Sorry to sound dense, JeffGrigg, but why would it be wildly impractical? Is it because of the the number of libraries that would have to be used or the size of the OS or something else?

If you think you can build an operating system that reliably emulates all the others, by all means, please feel free to do so! ;->

Generally, I'm skeptical of claims that something is impossible. But given the compatibility issues vendors have had between versions of their their own OS releases, thinking that one can reasonably build a "super OS" that reliably acts like all others is probably a bit naive.

Being able to run programs intended for another environment is valuable. So valuable that it has been attempted a number of times, with a fair amount of practical success. But only with a limited scope, with reasonable expectations, and there are always "corner cases" that don't work out.

(Welcome to the real world -- where life is often tough! ;-)

lol. I see. It is something I am still very interested in doing. But it would require far more knowledge than I have. Do you have any links to examples of OS's like the kind you mentioned? The practical ones I mean. With the limited scope. I'm just curious to see them. :)

How could you get the program to boot on startup (when the computer is turned on)? Also would there be a way to make the OS be able to read from an assigned partition only?

This if the OS that I will hopefully create, but it is useful to everyone and the OP, which is why I did not start a new thread.

@Dante2: "Wine" runs Microsoft Windows programs on Linux. It's not perfect; never will be. But it can be quite useful.

http://www.winehq.org/

@sirlink99: Most OSs respect partitions. Partitions in the "Wintel" world are well defined and generally work well. But they do just let you run one OS at a time; they don't integrate anything.

The OS in the one partition marked "active" boots. Most OSs let you change the active partition, so you can switch and reboot, and you'll be running a different OS (and disk partition).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.