Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Which JVM am I using?

843807Feb 12 2003 — edited Feb 13 2003
Hi all,
I'm working on testing some java code inside the browser. I've been using the MS JVM for a while, and I wanted test compatibility with the SUN JVM. I installed the 1.4.x J2RE and java plugin, and I expected the SUN magic to happen the next time I ran my app. No luck - when I bring up IE and login to my app server, it looks like it's all going through the MS VM.

Then I notice the IE option "Use Java 2 v1.4.1_01 for <applet>" as an option. It's checked on. Even when I bring up applets, there's no SUN love. My evidence is the fact that View|Java Console will show the MS console and the thread list refers to all of the stuff that I'm looking at.

The thing is, we're not using applets (as far as I know). All of the java code I'm working on are .class files I'm pulling into the browser in signed cabs, being invoked directly from client side HTML. No <applet> tags here.

So, my question - how do I ditch the MS JVM? For applets and for direct java calls?

Comments

unknown-7404
Answer

I have read and watched videos regarding creating an Object of a class and calling its method in a different class. I'm still confused about how to properly do this. Using the code below can anyone explain how to properly call the objects method from my main.

Huh? You have NOT posted any 'main' or any 'objects method'.

If you need help with code you have to post the code.

The Java tutorials has dozens of trails on 'Classes and Objects': what they are, how to create them and how to use them.

https://docs.oracle.com/javase/tutorial/java/javaOO/classes.html

1. Create an instance of a class

2. call one or more of the public methods of that class

If the class has public static methods then you do NOT need to create an instance first.

I suggest you work your way thru those tutorials. They include WORKING example code.

Marked as Answer by 2801625 · Sep 27 2020
aJohny

As rp0428 suggested, please go through the tutorials first, add extra debug messages in the samples if needed, get an understanding how things works.

You have not given the full code, so we can't help much.

By looking at the content, it looks like you have written this in the Constructor. Refer the below link to understand about Constructors

https://docs.oracle.com/javase/tutorial/java/javaOO/constructors.html

If the above piece of code is the constructor code, it will get executed when you create the instance of the class itself (with those number of parameters);

ex:= FileContentsObject fileContentsObject = new FileContentsObject( cachecName, lastModifiedTimeStamp,contents, fileName, lines);

I have used the same variable names as the ones defined in the class, which is not necessary. These variables has to be defined first.

Hope it helps.

Cheers

AJ

2801625

Thanks for the advice so far this info has proved to be extremely helpful.

1 - 3
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Mar 13 2003
Added on Feb 12 2003
6 comments
111 views