Error message: Error J0051: Undefined Package ''


When you try to compile a Java application as an NT service that uses classes in the class, you may receive the following Java compiler error message:
J0051: Undefined Package ''


The package is not part of the default Microsoft virtual machine (Microsoft VM) installation. Therefore, the compiler cannot locate the package when the compiler scans the default CLASSPATH.


If you are using Visual J++ 6.0 to build your NT service application, follow these steps to add the package file to the compilation CLASSPATH:

  1. On the Project menu, click Properties.
  2. In the Project Properties dialog box, click the CLASSPATH tab.
  3. Click New, and then type the fully-qualified path name for


The package is part of the Microsoft Software Development Kit (SDK) for Java installation. The package can be found in the Jntsvc subdirectory of the SDK installation in the file. The file must be included in the CLASSPATH for applications that use the Java .class files in the package. The Jntsvc folder also contains a Makefile for building a sample service. The sample service illustrates one way to include the package to the CLASSPATH for a command-line compile that uses the Microsoft Java compiler (Jvc.exe). The -cp:p command-line compiler option that appears in the Makefile prepends the package file to the default CLASSPATH at compilation time.

The information in this article pertains to the J0051 compilation error that you receive when you reference the package. The execution of the code with a package is a separate topic. For more information about code execution with a package, see the Readme.txt file in the Program Files\Microsoft SDK for Java 4.0\jntsvc folder.


To download the latest version of Microsoft SDK for Java, see the following Microsoft Web site:
For support information about Visual J++ and the SDK for Java, visit the following Microsoft Web site:

ID articol: 320722 - Ultima examinare: 14 feb. 2017 - Revizie: 1

Microsoft Software Development Kit pentru Java 4.0, Microsoft Visual J++ 6.0 Standard Edition