Applet: MVM and JVM

I have an applet which works wonderfully well when i use the java plugin.
i compiled it using this:
[code javac -target 1.1 PreviewApplet.java[/code]
it works properly when i use my java plugin, but when i disable it and use the microsoft VM which comes with Internet Explorer (as most of my customers will be doing)
my applet is a grey box with nothing on it, and in the status bar i get the message:
load: class PreviewApplet not found.
how can that be? the applet tag is the same for both the MVM and the JVM. or should it be different? im terribly confused as i thought that by compiling for JDK1.1 it would work (my applet doesnt use anything fancy that i need 1.4 stuff)
and there is no red X or a coffee cup symbol on the grey box (the applet) so i have no idea what to do.
can you help?

There is something in the applet that the old MSJVM is not capable of handling. IIRC, the MSJVM console can be opened from the IE View menu. Hopefully that will tell you something useful.
Much of the time using the -target 1.1 option will allow the applet to run - but sometimes it won't. There are still 2 other differences left unaccounted for.
First, the classes that you used to compile with are a later version, and can cause a runtime error. You can eliminate this problem by using -bootclasspath and -extdirs to cause compilation to be done against the old classes (which need to be on your machine.) Note that there's also a -Xbootclasspath option for the java command - though if that's needed, it would have to be on the machine that's running the applet.
Second, there may still be diferences between the Sun 1.1 VM and the MS 1.1 VM (after all, that's what the argument was about!) that will not allow the applet to run.
Take a look at the javac and java command documentation for the options that are available. You can probably find some additional help at the Sun Upgrade pages:
http://java.sun.com/upgrade/index.html

Similar Messages

  • Question regarding Applet and JVM

    Hi all!
    I'm working on an applet now and it's been working quite fine, just that when I run the same applet on different tab in a single browser window, it'll get some error.
    But if I run the applets in different windows, it'll be fine.
    So I'd like to know how does JVM handle the execution of applet?
    What is the difference between:
    - how JVM handles multiple applet in different-tab-in-single-browser and
    - how JVM handles multiple applet in different browser?
    Any help is greatly appreciated :)
    Thanks in advance ^^

    Sounds like you're using static fields. Not a good idea in applets because...
    What is the difference between:
    - how JVM handles multiple applet in different-tab-in-single-browser and
    - how JVM handles multiple applet in different browser?
    ...that's entirely up to the browser. Actually, your question's slightly misconstrued. What you should really ask is,
    What is the difference between:
    - how the browser spawns JVMs in different-tab-in-single-browser and
    - how the browser spawns JVMs in different browser?
    Either way, it's out of your hands. Which is why you're going to have to be very careful about using statics: if you use them for state information then another applet can trash them; if you use them for inter-applet communication you might not reach one applet from another.

  • Error when accessing Java and JVM section

    I'm getting the following error when accessing the Java and
    JVM section of the CF Administrator:
    "Element JDKPATH is undefined in FORM"
    I've searched a lot and there's very little on the topic. On
    this forum there are two posts and one got no answer, on the other
    it was suggested it might be the jvm.config file. I've looked at
    mine but I really have no idea what could be wrong. Also, there are
    two jvm.config files in my install, one in jrun4/bin and another in
    jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/runtime/bin
    folder (I did multiserver installation).
    I've already tried a bunch of things and no luck, any help is
    appreciated on this.

    quote:
    Originally posted by:
    ke4pym
    What is your path? Make sure you're using forward slashes.
    ie: d:/java/jdk1.6.0_12/bin/blah/blah/blah
    What path are your referring to? My actual PATH environment
    variable? Or are you referring to something else. Btw, here's what
    my config file looks like right now.
    # VM configuration
    # Where to find JVM, if {java.home}/jre exists then that JVM
    is used
    # if not then it must be the path to the JRE itself
    java.home=C:/JRun4/jre
    # If no java.home is specified a VM is located by looking in
    these places in this
    # order:
    # 1) bin directory for java.dll (windows) or
    lib/<ARCH>/libjava.so (unix)
    # 2) ../jre
    # 3) registry (windows only)
    # 4) JAVA_HOME env var plus jre (ie $JAVA_HOME/jre)
    # Arguments to VM
    java.args=-server -Xmx512m -Dsun.io.useCanonCaches=false
    -XX:MaxPermSize=192m -XX:+UseParallelGC
    -Dcoldfusion.rootDir={application.home}/
    # commas will be converted to platform specific separator and
    the result will be passed
    # as -Djava.ext.dirs= to the VM
    java.ext.dirs={jre.home}/lib/ext
    # where to find shared libraries
    java.library.path={application.home}/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusi on/lib,{application.home}/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/jintegra /bin,{application.home}/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/jintegra/b in/international
    system.path.first=false
    # set the current working directory - useful for Windows to
    control
    # the default search path used when loading DLLs since it
    comes
    # before system directory, windows directory and PATH
    java.user.dir={application.home}/../lib
    # JVM classpath
    java.class.path={application.home}/servers/lib,{application.home}/lib

  • Resizing an Applet window and components.

    How can I resize an applet window and not compromise the layout of components in the applet's panel? Can i get the components to resize as the applet's window resize?

    Try using GridBagLayout as your LayoutManager. Then use GridBagConstraints to specify the components behaviour on resizing.
    Hope that helps.

  • Loading part of a applet first and init

    Hi,
    I'm developing a applet and currently the size of it quite large. so i want to divide applet into two parts and hope to load one part of applet first and second part is downloading while first part is running.
    the main problem here is, this applet should be run on MS VM (jdk 1.1.8). i have some idea to copy second jar file to local machine classpath and then access it on demand. in this case, seems jar is need to copy local machine before applet is loaded.
    please help me to resolve this problem......
    Janath

    Hi,
    1.Please make sure the update deployment is show up on the Deployment tab(Assets and Compliance -> Overview -> Devices -> the specific client properties)
    2.Check PolicyAgent.log on the client to see whether the specific client have received the deployment policy. If not, try to run the Actions about software updates on the Configuration Manager Properties from the client.
    3.Examine UpdatesDeployment.log, UpdatesHandler.log. UpdatesStore.log on the client.
    Best Regards,
    Joyce Li
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • Difference between JVM  of web browser and  JVM of webcontainer?

    hi friends , I am babu pursuing mca final year
    i have one doubt that is ........
    What is the difference between JVM of web browser and JVM of web container ?
    plz clarify my doubt

    Who said there's a difference?
    (By "web container" I assume you're talking about a servlet container or JSP container like tomcat.)

  • Runtime.exec failure in applet(IE and Netscape)

    Hi
    Runtime.exec() failures to execute an executable(VB) in an Applet with Internet Explorer and Netscape Navigator. But the same is working fine with Mozilla Firefox and Opera. All the four browsers can load the applet successfully and listens the Swing component's action by actionlistener. But the problem is that IE and Netscape cant execute a VB created executable. The sample code of failure part is:
    public void actionPerformed(java.awt.event.ActionEvent e){
    Runtime.getRuntime().exec(abc.exe);
    Here abc.exe is a VB exe for doing simple thing.
    Plz help me on it if anyone knows about it..................
    Raz
    Message was edited by:
    rashidul

    hi,
    1st: 40MB is maybe a little bit too much :-)
    2nd swing is not really good for applets and espicially not for IE
    regards

  • Applets, RMI, and mySQL OH MY!

    This is not gonna be easy to explain, but I will try....
    1) I have successfully created an RMI applet client, and I can access the mySQL database on another server that has both the RMI server and the mySQL together. So this works great.
    2) On further experiment, I have another server that hosts only the mySQL database and not the RMI server. I host the RMI server on the same system as the RMI applet client, including the mySQL driver jar file; the code is exactly the same as in (1) as far as the client/server RMI goes because I pass the host:port information through the client to the RMI server which within invokes the mySQL database connections/queries.
    I find that this fails.
    The RMI client does connect successfully to the RMI server, but
    the RMI server cannot make the call to connect to the remote database.
    The error I received is:
    java.net.SocketException
    MESSAGE: java.net.ConnectException: Connection refused: connect
    Ok, I am thinking that since I am running an applet and thus in a sandbox, I had assumed that as far as the applet is concerned, the
    RMI client/server is LOCAL and it is no business of the applet to be
    concerned with what the RMI server chooses to do internally, right?
    I mean, in (1) above it all works fine as the RMI server and mySQL
    database is on the same system so everything is LOCAL - but in
    (2) above - seperating the RMI server from the database is not the
    same thing - thus breaks the sandbox rules?
    Care to comment?
    Kind regards,
    Dan

    Gah.... Never mind. I solved my issues. I thought I seperated
    the logic of the RMI host information from the database connectivity
    information and it turns out that I didn't.
    I thought it was Monday but it is Friday obviously at least in locale PST
    Kind regards,
    Dan

  • Change Applet AID and 6999 Response APDU

    Hi,
    I have a Project A in Eclipse window. Can I change the package AID and applet AID before I load the applet into the smart card?
    When I use Wallet applet, after I enter wrong password for several times (tesing), it keeps return 6999 Response APDU whenever I select this applet? How can I fix this problem? Before that, the applet worked well when I entered correct password. Thank you very much.

    Without the applet source and APDU trace its hard to analyze..
    Your Wallet applet probably has a security mechanism implemented such as that if the OwnerPIN is blocked, the applet returns false in the select() method, hence the return code that application selection failed.
    You could solve the problem by
    1. delete the applet
    2. create a new instance
    or
    send an APDU to unblock the PIN

  • Applet, Netscape and Opera but not IE, encore

    I've got the following trivial applet that runs under Netscape and Opera, but not under IE. It's also at www.MartinRinehart.com as the ColorChooser choice. There's a half dozen Dukes from previous posts, and my sincere gratitude for anyone who can tell me what I need to do so IE doesn't say "Load: class CCApplet not found."
    import java.awt.BorderLayout;
    import java.awt.Button;
    import java.awt.Label;
    public class CCApplet extends java.applet.Applet {
         public void start() {
              Label l = new Label( "CCApplet!" );
              setLayout( new BorderLayout() );
              add( l, BorderLayout.NORTH );
              add( new Button("South"), BorderLayout.SOUTH );
    } // end of class CCAppletThe .class is in the same directory as the .html. Putting it in a .jar doesn't seem to matter. My IE runs other applets from the web, but not the ones I write. Thanks in advance.

    The applet runs for me in IE with 1.5.0_02, XP Pro (current updates), with class and html files in same directory.
    Check that everything in IE's Java Plug-in is valid and correct. Check IE's Internet Options.
    What JVM version are you wanting the applet to be able to run with? What does this statement mean? "...most visitors can use without knowing what a JRE is."
    To get greatest compatibility, use code that conforms to the 1.1 API, compile to that target version, possibly use the old 1.1 libraries, and then test each jvm. (BTW - Swing has limited compatibility - it isn't MS compatible, and wasn't [Sun] standard until jvm version 1.2.)

  • Java Plug-in 10.4.1.255 occasionally lauches applets in separate JVMs

    I have a web page with an applet and I can add other applets to this page in runtime. These applets need to communicate with the first applet, so they all must be run in the same JVM instance. But since the last Java Plug-in update (10.4.1.255) it became impossible. New applets occasionally start in new JVM. separate_jvm=false doesn't solve the problem.
    You can test it with this demo: http://demo.aurigma.com/ImageUploader7/MultipleDescriptionsDemo/Default.aspx. Just add some images; thumbnail applets started in new JVM cannot connect to uploader applet.
    Is there any way to launch all applets in the same JVM instance?

    The same problem happened to me. When upgrading from JRE 1.5.0_5 to JRE 1.5.0_6, suddenly no applets would load, and all I could see was the little red X.
    I tried to change proxysettings (I dont use a proxy, but it is told at http://www.java.com/en/download/help/redximage.xml that it is due to wrong proxy-settings). It didn't help.
    I tried to turn off zonealarm. It didn't help.
    I tried to clear the browsers cache. It didn't help.
    I have been using both Firefox 1.5, and IE6. None would load the java-applets.
    So I uninstalled all older JRE versions and installed JRE 1.4.1_02. It worked!
    I then tried to upgrade to JRE 1.5.0. It didn't work.
    Now I am back at JRE 1.4.1_02 without knowing why I had to downgrade through 6 versions that through the last year or so has been working fine on my machine.
    I have no idea why it suddenly wouldnt work with the newer versions.
    Any ideas?
    Thank you.

  • Applet problems and another question

    Hey guys, I am having two problems with some code of mine.
    (1) I can't get this code to run in a browser, it says the class DrawingFrame is not found, but it is in the same directory and it runs using JBuilder in an applet viewer. What is wrong?
    (2) I need to calculate the lengths of the paths in a fractal tree. I have no idea how to do this correctly. I can calculate it when both path scales are the same but when they are different everything is shot. Plus it prints out twice as many lengths as there are paths!
    Please help with this problem, I have been pulling my hair out, thanks.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import com.borland.jbcl.layout.*;
    import javax.swing.event.*;
    import javax.swing.border.*;
    import java.awt.geom.*;
    import java.io.*;
    import java.util.Vector;
    public class DrawingFrame extends JApplet {
      JPanel contentPane;
      XYLayout xYLayout = new XYLayout();
      Graphics g = getGraphics();
      Button startButton = new Button();
      Button clearButton = new Button();
      Label rRatioLabel = new Label("R Branch %");
      Label lRatioLabel = new Label("L Branch %");
      Label rAngleLabel = new Label("R Angle");
      Label lAngleLabel = new Label("L Angle");
      Label iterationsLabel = new Label("# Iterations");
      TextField rRatio = new TextField("60");
      TextField lRatio = new TextField("60");
      TextField rAngle = new TextField("45");
      TextField lAngle = new TextField("45");
      TextArea pathLength = new TextArea();
      TextField iterations = new TextField("3");
      void clearButton_actionPerformed(ActionEvent e) {
            Graphics g = getGraphics();
            reset(g);
            }  //end clearButton_actionPerformed
      void startButton_actionPerformed(ActionEvent e) {
          Graphics g = getGraphics();
          int rRat = Integer.valueOf(rRatio.getText()).intValue();
          int lRat = Integer.valueOf(lRatio.getText()).intValue();
          int rAng = Integer.valueOf(rAngle.getText()).intValue();
          int lAng = Integer.valueOf(lAngle.getText()).intValue();
          int itera = Integer.valueOf(iterations.getText()).intValue();
          assignStats(contentPane.getWidth()/2,contentPane.getHeight()-20,rRat,lRat,rAng,lAng,itera);
           drawTree(g,contentPane.getWidth()/2,contentPane.getHeight()-100, Math.PI/2, 100, 100, itera, 100, 100);
             }  //end startButton_action performed
             private int xstart,ystart;
             double rRat, lRat, rAng, lAng,lLength,rLength;
             int itera;
      public void assignStats(int xStart, int yStart, int rRat, int lRat, int rAng, int lAng, int itera)  {
                  xstart = xStart;
                  ystart = yStart;
                  this.rRat = (double)rRat/100;
                  this.lRat = (double)lRat/100;
                  this.rAng = (double)180/rAng;
                  this.lAng = (double)180/lAng;
                  this.itera = itera;
                }  // end assignLocation
      public void drawTree( Graphics g, int x, int y, double a, double lLength, double rLength, int itera, double rpath, double lpath)  {
             if (itera<0) {
               rpath = rpath - lLength;
               pathLength.append(rpath+" ");
               return;
                   int x0 = x + (int)(lLength*Math.cos(a));
                   int y0 = y - (int)(lLength*Math.sin(a));
                   g.drawLine(x, y, x0, y0);
                   lLength = lLength*lRat;
                   rLength = rLength*rRat;
                   rpath = rpath + lLength;
                   lpath = lpath + rLength;
                   double a0 = a+Math.PI/rAng;
                   double a1 = a-Math.PI/lAng;
                   itera--;
                   drawTree(g, x0, y0, a0, lLength, rLength, itera, lpath, rpath);
                   drawTree(g, x0, y0, a1, rLength, rLength, itera, rpath, lpath);
      public void reset(Graphics g) {
                   g.setColor(Color.lightGray);
                   pathLength.setText("");
                   g.fillRect(0,0,900,900);
                   }  //end reset
                 //Component initialization
      public void init() {
               startButton.setBackground(Color.red);
               startButton.setFont(new java.awt.Font("Dialog", 1, 14));
               startButton.setForeground(Color.blue);
               clearButton.setBackground(Color.red);
               clearButton.setFont(new java.awt.Font("Dialog", 1, 14));
               clearButton.setForeground(Color.blue);
               startButton.setLabel("Draw Tree");
               clearButton.setLabel("Clear Tree");
         startButton.addActionListener(new java.awt.event.ActionListener() {
                 public void actionPerformed(ActionEvent e) {
                        startButton_actionPerformed(e);
         clearButton.addActionListener(new java.awt.event.ActionListener() {
                           public void actionPerformed(ActionEvent e) {
                             clearButton_actionPerformed(e);
                     contentPane = (JPanel) this.getContentPane();
                     contentPane.setLayout(xYLayout);
                     this.setForeground(Color.black);
                     contentPane.setBackground(Color.lightGray);
                     contentPane.add(startButton, new XYConstraints(470, 5, 119, -1));
                     contentPane.add(clearButton, new XYConstraints(470, 35, 119, -1));
                     contentPane.add(rRatioLabel, new XYConstraints(10, 10, 60, 18));
                     contentPane.add(lRatioLabel, new XYConstraints(90, 10, 60, 18));
                     contentPane.add(rAngleLabel, new XYConstraints(170, 10, 60, 18));
                     contentPane.add(lAngleLabel, new XYConstraints(250, 10, 60, 18));
                     contentPane.add(iterationsLabel, new XYConstraints(330, 10, 60, 18));
                     contentPane.add(rRatio, new XYConstraints(10, 25, 50, 18));
                     contentPane.add(lRatio, new XYConstraints(90, 25, 50, 18));
                     contentPane.add(rAngle, new XYConstraints(170, 25, 50, 18));
                     contentPane.add(lAngle, new XYConstraints(250, 25, 50, 18));
                     contentPane.add(pathLength, new XYConstraints(10,65,760,75));
                     contentPane.add(iterations, new XYConstraints(330, 25, 50, 18));
                 }  //end drawingFrame

    You are using Swing in an applet.
    1) Are you using Sun's plugin (JRE 1.4) or Microsoft JVM?
    2) The code
    import com.borland.jbcl.layout.*;indicates that you probably would have to include some Borland classes in your applet JAR file (I don't know which ones to include!) if you want to run the applet.
    List the JAR please:
    jar tf <your applet jar file>
    Example:
    jar tf myapplet.jar
    It will help you.
    For instance, if you do not get in your listing a line like:
    DrawingFrame.class
    your applet will never run.

  • Profiling tool for applets using Microsoft JVM?

    Hello All,
    I have an applet designed to work in Microsoft JVM. It is slow and sometimes crashes the browser and I doubted that it caused memory leak. Therefore, I wish to have a profiling tool which can collect time and memory consumption from Microsoft JVM.
    Please advice.

    simply: there is none.
    Its even impossible to denug it withought a legal copy of J++, trust me MSJVM really sucks.
    I have to create a really big applet which is compatible to Netscape-4.7 and MSJVM-3167+ and its nightmare. One change and the whole cardhouse breaks.
    I do not want to make you feel sad, but leave it.
    lg Clemens
    PS: I would try to create as few objects a s possible, the ms-gc is not very powerful nore stable...

  • Windows CE 5.0 (pocket pc honeywell) and JVM

    hi friends, can install the Java Virtual Machine on Windows CE v5.0?
    if yes how to?
    second question (if is possible install the jvm) i think can i run applets in Internet Explorer? right?
    Thanks

    It is interesting that you state "the" Java Virtual Machine... as if there is one and only one.
    A quick Google search for "JVM Windows CE" turns up some choices and discussions.  Once you find one that you want to use, you will need to contact the supplier and ask your questions about installation and IE support.
    Further, it may be significant to the suppliers that you are running Pocket PC (and the version).  While PPC was based on Windows CE, it is different.  And more than one PPC release was based on Windows CE 5.0.
    Bruce Eitman (eMVP) Senior Engineer Bruce.Eitman AT Eurotech DOT com My BLOG http://geekswithblogs.net/bruceeitman Eurotech Inc. www.Eurotech.com

  • Newbie Topic - compiling errors and jvm.dll missing

    Okay, we're starting at square .1 here. I'm trying to compile the ClickMe.java in the tutorial for newbies like myself. I know how to compile from the command line, etc., but I get an 2 errors. Seems to be saying line 6, cannot resolve symbol and line 28.
    - - - - code below - - - - - -
    import java.applet.Applet;
    import java.awt.*;
    import java.awt.event.*;
    public class ClickMe extends Applet implements MouseListener {
    private Spot spot = null;
    private static final int RADIUS = 7;
    public void init() {
    addMouseListener(this);
    public void paint(Graphics g) {
    // draw a black border and a white background
    g.setColor(Color.white);
    g.fillRect(0, 0, getSize().width - 1, getSize().height - 1);
    g.setColor(Color.black);
    g.drawRect(0, 0, getSize().width - 1, getSize().height - 1);
    // draw the spot
    g.setColor(Color.red);
    if (spot != null) {
    g.fillOval(spot.x - RADIUS,
    spot.y - RADIUS,
    RADIUS * 2, RADIUS * 2);
    public void mousePressed(MouseEvent event) {
    if (spot == null) {
    spot = new Spot(RADIUS);
    spot.x = event.getX();
    spot.y = event.getY();
    repaint();
    public void mouseClicked(MouseEvent event) {}
    public void mouseReleased(MouseEvent event) {}
    public void mouseEntered(MouseEvent event) {}
    public void mouseExited(MouseEvent event) {}
    - - - - - - end ClickMe.java code - - - - -
    I thought maybe it was b/c the Spot was capitalized, but I changed that to l/c and that didn't help. This code is, of course, taken right off of this page:
    http://java.sun.com/docs/books/tutorial/java/concepts/practical.html
    The other thing that's happening, is that when I try to run the NetBeans IDE 3.6, I get an error "Cannot load jvm.dll." I know there are jvm.dll's on this machine, but maybe they're in the wrong directory. I haven't messed with anything, just d-loaded the whole j2se SDK 1.4.1 and i'm already snafu'd. But then, I'm a newbie, so go ahead make fun. But, if you can, offer advice.
    thx in advance!

    I seem to be compiling right, b/c I was able to compile the classic HelloWorld.java ok and I can compile the spot.java file ok. I see what looks to be a valid spot.class file after I compile. If you're really bored, I could describe exactly how I'm launching the cmd.exe and how I point successfully to the javac.exe, but, newbie that I am, can we just go on faith that I'm doing that step right? And I also tried re-compiling the Spot.java file first, trashing the original ClickMe.java file so that everything was sequential. I'm wondering if this has something to do with the IDE & that jvm.dll out of whack.....
    As for the Netbeans IDE, I'm going to see if I can reinstall that separately. The whole SDK maybe didn't unpack correctly, who knows.
    But thanks for responding......

Maybe you are looking for