Documentation Contents

Note: This Java deployment guide describes features released prior to the Java SE 6 update 10 release. See Java Rich Internet Applications Development and Deployment for the latest information.

java.lang.ClassNotFoundException thrown on com.ms.* package when applet runs

Symptoms

When running an applet in a browser by using the Sun Java™ Runtime Environment (JRE™), a java.lang.ClassNotFoundException is thrown by ClassLoader on the com.ms.* package. The same applet runs without any error under the Microsoft Virtual Machine (VM).

Cause

The Microsoft VM provides many proprietary class libraries, including J/Direct, Application Foundation Classes (AFC), and Windows Foundation Classes (WFC). These packages are not available in the Sun JRE, so a java.lang.ClassNotFoundException is thrown when an applet runs in the browser.

Resolution

Migrate the applet source code from using the Microsoft proprietary class libraries to similar classes in the Java platform. The following table shows a list of Microsoft VM and Java Platform class libraries:

Microsoft VM Java Platform
J/Direct Java Native Interface
Application Foundation Classes Swing, Java 2D APIs
Windows Foundation Classes Swing, Java 2D APIs

Related Information

How to avoid potential pitfalls of Microsoft's non-standard SDK for Java
Trail: Creating a GUI with JFC/Swing
Lesson: Learning Swing with the NetBeans IDE


Oracle and/or its affiliates Copyright © 1993, 2013, Oracle and/or its affiliates. All rights reserved.
Contact Us