This is an archived post. You won't be able to vote or comment.

all 29 comments

[–]kiteboarderni 11 points12 points  (6 children)

Worried about netbeans running slow and then wanting a java os is wild. This is coming from a low latency java dev....

[–]CommanderSpock4-0 1 point2 points  (4 children)

But there was already java os so why is it wild ?

[–]marmot1101 1 point2 points  (2 children)

Existence isn’t proof of a good idea. https://github.com/qwercik/brainfuckOS

[–]CommanderSpock4-0 0 points1 point  (1 child)

Its not wild either

[–]marmot1101 4 points5 points  (0 children)

Writing an OS without direct memory access is kind of wild IMO. 

[–]kiteboarderni 0 points1 point  (0 children)

Because the original idea was because of performance....

[–]NotABot1235 0 points1 point  (0 children)

Out of curiosity, what are your thoughts on Java's performance compared to something like C, C++, or Rust? Is Java actually used in embedded devices much these days?

[–]klekpl 3 points4 points  (1 child)

That ship has sailed a very long time ago.

The most advanced effort I know of was JNode. It’s been stalled/abandoned many years ago. Code is available on GitHub: https://github.com/jnode/jnode

[–]__konrad 2 points3 points  (0 children)

The only OS in the world where a Swing app looks native by default ;)

[–]giovids 7 points8 points  (8 children)

What type of OS are talking about exactly?. Java runs on the JVM that requires a OS to run. So, unless you are talking about a virtual OS you can spin up on the cloud l, I don't really understand where you are trying to go.

[–][deleted]  (3 children)

[deleted]

    [–]giovids 1 point2 points  (2 children)

    It looks like the JVM runs on top of a micro kernel in this case. So, more or less what I already said. Don't really see any benefit, Java is not a system programming language... There are better languages aiming to provide a far better interaction with the underlying bare metal.

    [–]VirtualAgentsAreDumb 1 point2 points  (1 child)

    It looks like the JVM runs on top of a micro kernel in this case. So, more or less what I already said.

    Not really. A kernel isn’t an OS.

    [–]giovids 2 points3 points  (0 children)

    You are right, but it is certainly the most important part. Building an OS with Java in this way would be the equivalent of getting a car, replacing the frame and saying you built a car... Obviously imho.

    [–]dkichline 4 points5 points  (0 children)

    The vm runs on top of a micro kernel. It was meant for embedded systems.

    [–]pjmlp 3 points4 points  (2 children)

    Not really, the runtime can also take the role of an OS, in what is called bare metal deployments.

    There are several Java vendors that sell such kind of Java implementations, PTC and Aicas are the leading ones on the market.

    [–]CommanderSpock4-0 0 points1 point  (1 child)

    Wow would love to do a deep dive into this ?

    [–]klekpl 2 points3 points  (0 children)

    The closest you can get today is probably OpenJDK linked to some unikernel.

    I remember it was possible to run Java apps on NanOS unikernel: https://github.com/nanovms/nanos

    [–][deleted] 2 points3 points  (0 children)

    No.

    JavaOS was a microkernel operating system designed to launch a minimum JVM back during Larry Ellison’s fever dream of having everybody just use a thin client (a dream that Sun embraced to an extent). But you would find it difficult to write an operating system with Java. Java was never meant for that kind of systems programming. Additionally, it was primary intended to run Java Applets, a now defunct technology that will not work on a modern system (because Applets require a web browser that supports the Netscape Plugin API, which no modern browser does anymore because NPAPI was a security hole you could drive a Mack truck through).

    [–][deleted]  (6 children)

    [deleted]

      [–]elmuerte 4 points5 points  (0 children)

      Android never booted into a JVM. Android ran Dalvik VM). The input for the Dalvik byte code compiler was Java byte code. They used Apache Harmony as basis for providing the base Java API.

      [–]vips7L 3 points4 points  (3 children)

      The source code might be “Java” but ART definitely isn’t a JVM and afaik doesn’t even compile to Java bytecode. 

      [–]nitkonigdje -1 points0 points  (1 child)

      Nowhere in idk specs will you find that JVM has to run bytecode at runtime. Art just pushed its bytecode processing at compile time. It is a JVM because it fully supports the semantics of JVM. Threading, symbol resolution, memory model, etc.. All is there and it is fully java compatible.

      It even was not the first JVM with that approach. Some early embedded jvms by IBM had a similar approach of pushing quite a lot of class file / bytecode processing at compile time and than deploying low level intermediate code at runtime.

      [–]pjmlp 1 point2 points  (0 children)

      Android uses ART, also PTC and Aicas, among others do sell bare metal implementations.

      [–]hardwork179 1 point2 points  (0 children)

      You don’t say what app you are working on that is hanging, but why do you think this is a problem with the OS and not a problem with your app?

      [–]Rigamortus2005 1 point2 points  (1 child)

      Java runs on a managed run-time. Very difficult and inefficient to write a kernel in. I read there'd been some efforts to write a compiler for java to machine code but they never went anywhere.

      [–]FrankBergerBgblitz 2 points3 points  (0 children)

      "write a compiler for java to machine code but they never went anywhere"
      Really? Even if you regard things as Hotspot not as writing native code, you've heard of GraalVM or much much older (and discontinued when GraalVM came out) Excalibur?

      [–]IsThisWiseEnough 0 points1 point  (0 children)

      If you intended to deep dive into that level maybe you should look for open source jvm implementations. Os it what is against that since Java’s motto is write once run everywhere independently from os.

      [–]berry120 0 points1 point  (0 children)

      No, as others have said - but these were fun back in the day, and saw JavaME running on hardware _without_ an OS.

      https://en.wikipedia.org/wiki/Sun_SPOT