• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Which JVM to use?

 
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a class that I put together, loosly based on some Microsoft sample code:

And then I made sure that the com.ms.util.SystemVersionManager class could be found in com\ms\util\ in the same directory as my Java source file (I extracted it from a zip archive that is part of the MS Virtual Machine installation for Win2000).
It compiled just fine, and then, just to make sure I knew what JVM I am calling when I run "java" from the command line, I did this:

And then I ran my code. Now I was expecting errors galore, as it would be highly unusual for the BEA JVM to mimic very closely the MS VM. But what I actually got was wholly unexpected. The code ran in the native MS VM!
Output:

Some other relevant info:

No CLASSPATH is set.

So, what the heck just happened?
PCS
[ November 20, 2002: Message edited by: Philip Shanks ]
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you sure that no classpath is set?
Open a DOS window and at the prompt type
>set
then look for the classpath parameter.
(or you can use the "echo %classpath%" command)
If the code that you executed only uses classes up to the level that MS has loaded it would work correctly.
 
Philip Shanks
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I just confirmed... no %CLASSPATH% environment variable. Somehow, by accessing the com.ms.util.SystemVersionManager, the code winds up executing in the MS VM.
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I just happened to open the mentionned class in Decafe (Java decompiler). The values are actually hard-coded into the class
Hence, I'm pretty convinced you've still be running the same VM as before
 
I didn't say it. I'm just telling you what this tiny ad said.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic