[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

 

Appendix B.

 

Troubleshooting



This section is designed to give you a quick reference point for common problems with their solutions when targeting the Java VM with CodeWarrior. This should be the first place you look before contacting technical support.

Troubleshooting questions and answers cover the following main categories:


Programming Problems

This section deals with problems encountered writing Java code using the CodeWarrior development environment. The following issues are covered in this section:


Cannot Find Main Class in Java Application


Problem

The following errors are encountered when building Java applications (depending on which host CodeWarrior is running on, and which VM is being used):


Solution

The common cause of this error is the incorrect entry of the Main Class name in the Java Target panel. Open this panel by choosing Edit > TargetName Settings (where TargetName is the name of the build target in question), then select Java Target from the settings panels list on the left side of the window. Make sure that the Main Class field matches the name of the main class in your code. Remember that class names are case sensitive; and you must specify the fully-qualified class name when a class is in a package.

If this field does match your main class exactly, make sure that you have a virtual machine installed on your computer. CodeWarrior can use the Apple MRJ, Sun JDK 1.1.6 (or higher), and Microsoft Internet Explorer 4.0 as a virtual machine. We include all of these on the CodeWarrior CD(s). You can specify which one you want to use via the Virtual Machine pop-up menu in the Java Target panel. You can also download the latest versions from Apple, Sun or Microsoft.


Invalid Class Name in Applet Tag


Problem

This error may be worded in one of the following ways, depending on which host CodeWarrior is running on, and which VM is being used:


Solution

This is usually the result of the class name specified in the applet HTML tag not matching the actual class name in the Java code. Make sure that the class name in the applet tag matches the name of the main class in your code. Also be sure that the name of the class file matches the name of the main class. Remember that class names are case sensitive.


Jar extension missing from File Mappings


Problem

My install is missing the .jar extension in the File Mappings settings panel. What are the correct entries for this extension?


Solution

If you are missing the default entry for Jar files in the File Mappings settings panel, make sure that the entry you add is set up the following way:

File Type  
(blank)  
Extension  
.jar  
Flags  
(blank)  
Compiler  
MW Java  

With these settings, added .jar files will be found by imported classes in your project.


Unsatisfied Link Error Exception in Debugger


Problem

Linker errors unrelated to my Java project are stopping the debugger.


Solution

Check to see if you have the debugger set to break on all exceptions. Set the Debug > Break on Java Exceptions menu to Uncaught Exceptions or Exceptions in targeted classes. This should prevent breaking on exceptions being thrown by the Java VM. Otherwise, just press OK when the exception window is displayed, and you should be able to continue debugging.


The IDE Quits With a Type 12 Error


Problem

When I try to debug my application that merges the classes.zip file into the project output, the CodeWarrior IDE 3.2 immediately quits with an error type 12.


Solution

Merging the classes.zip file into the output causes the output file to bloat to over 4 megabytes. Do not merge the classes.zip file into the project output.


Macintosh Attempts to Dial Out When Running Applets


Problem

Running applets from within the CodeWarrior IDE causes the Macintosh to attempt to connect to the internet.


Solution

Try setting up your TCP/IP control panel like so:

Connect via  
AppleTalk (MacIP)  
Configure  
Using MacIP Manually  
IP address  
Enter any valid IP address, such as 10.1.0.1.  
Name server address  
Enter the same address as used for the IP address.  
Search domains  
Enter a domain name like "mylocalhost."

Create a file named "hosts" in the system Preferences folder, and add this line to it"

mylocalhost A [IP Address]

Where [IP Address] is the same address used in the IP address field in the TCP/IP control panel.

You should use the File > Configurations menu command in the TCP/IP control panel to save these settings so you can easily switch between your normal internet settings and the new "local server" settings.


Conversion Problems

This section deals mainly with problems encountered converting older CodeWarrior Java projects to the latest release. The following issues are covered in this section:


Cannot Convert Older Droplet Projects


Problem

The Droplet project type was used in previous versions of CodeWarrior to make a "pseudo" stand-alone applet. Droplet is no longer supported by CodeWarrior.


Solution

While the Droplet type is no longer supported, you can still make a stand-alone Java application with CodeWarrior. The CodeWarrior project converter does not convert your project to the new type for you. The best method is to use the stand-alone Applet stationery and create a new project. Then add your Java source files to this project.

See "Stand-alone Applications for Mac OS" for more information.


Additional Problems

If you find you are having problems not covered in this section, please send a bug report to Metrowerks support, cw_support@metrowerks.com, and that information will be added to future versions of this manual.

 


[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.

Last updated: August 02, 2000