2 ms·
Why not just ask the current jvm what version it is and act accordingly? I mean surely you can advise the user / customer what JVM's your code is compatible wit
by mousepilot 5y ago
Why not just ask the current jvm what version it is and act accordingly? I mean surely you can advise the user / customer what JVM's your code is compatible with, which really translates to what JVM's you have tested your programming on, right?
I'm obviously surrounded by folks far smarter than me, so I'm posting something probably grossly uninformed to see what the experts think!
- jolux 5y ago>Why not just ask the current jvm what version it is and act accordingly? I would! That's more or less what I was saying. But earlier on in the life of Java, there were technologies like Web Start and applets that could be embedded in webpages and the idea was that they would run on the client much like JavaScript does today, and you would have little idea of what the client environment was like, other than "it's a JVM." That turned out to be a bad idea for a number of reasons, most famously security, and the situations in which you can't just bundle your JVM are dwindling.
- mousepilot 5y agoFair enough! Still, I'm thinking many javascript pages query to find out the browser environment and also act accordingly. I do agree with the security complaint, however I also like web apps. I do think that you are sort of implying that web applets can't determine which jvm they're running under, is this really the case? Was there any reason that the java webapp folks prevented the applet from inquiring of the java version? This page chats about the version stuff for applets, it seems even with applets there was some options for picking the java version: https://docs.oracle.com/javase/8/docs/technotes/guides/deploy/applet_dev_guide.html https://docs.oracle.com/javase/8/docs/technotes/guides/deplo... You've made a nice argument for bundling the jvm so maybe I should change my inclination there, especially since I do like avoiding depencencies.
- jolux 5y ago> I do agree with the security complaint, however I also like web apps. Java applets are basically dead at this point, it’s all JS. > I do think that you are sort of implying that web applets can't determine which jvm they're running under, is this really the case? Was there any reason that the java webapp folks prevented the applet from inquiring of the java version? I never wrote applets but the point I was trying to make is that your environment is fundamentally unknown in that context. You could query for different versions and so on, but you would probably never know for sure because you don’t control the runtime environment (everything from the JVM down to the OS). This was supposed to be a big selling point of Java and it has for the most part turned out to be more trouble than it’s worth. That’s all.