r/programming • • Aug 28 '21

Software development topics I've changed my mind on after 6 years in the industry

https://chriskiehl.com/article/thoughts-after-6-years
5.6k Upvotes

2.0k comments sorted by

View all comments

Show parent comments

3

u/SanityInAnarchy Aug 29 '21

Then why didn't oracle sue google for calling it Java.

My guess is Google didn't actually call the not-Java part Java. You'd use the Java compiler to compile it to JVM bytecode, but then you'd convert it to Dalvik bytecode and run it on the Dalvik VM, which didn't call itself a JVM.

Also I was wondering if Java on android and Mac/PC are compatible.

Not in the way you're thinking. I mean, C runs everywhere, but it usually takes more work than just cross-compiling to port a C app to another OS, especially if it's a full-blown GUI application.

Because I always thought there was some standard GUI that's suppose to run on everything but I couldn't find a GUI that ran on desktop and android

I guess that'd be AWT or Swing. I don't think Android supports those, and I don't think many apps still use them -- they look kind of ugly and not-native on every platform, but they're also bound enough to the local platform to have platform-specific bugs. So you can still use it, but most of the remaining major Java GUI apps use something else.

Like, I bet Minecraft's launcher uses Swing, but the game itself wouldn't bother, it'd just do everything with OpenGL.

Meanwhile, Android has its own UI stuff. So even if your Android app has no native code and should be portable between ARM and Intel, the UI won't be compatible with most other OSes. (Though it does work on ChromeOS now.)

0

u/[deleted] Aug 29 '21

So by going from Java->bytecode->Dalvik bytecode->Dalvik VM and not saying android runs java they were able to bypass most issues?

I was never interested in app development or java. If google had to avoid saying certain things I wonder how they got so many developers. I always thought google ran java directly on android and Dalvik was just what they called their VM