×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Regular Contributor
    Join Date
    Sep 2003
    Location
    Finland
    Posts
    99

    Cannot create class in system package

    I get message: "Cannot create class in system package" when running on 7210 or 3510i emulator. It works fine on 3300 emulator and on all the S60 emulators. Is there any known problem resulting this kind of output? I also tried an obfuscator to simplify the class/variable names, didn't help.

  2. #2
    Super Contributor
    Join Date
    Mar 2003
    Location
    Israel
    Posts
    2,280
    You're probably trying to use some classes that don't exist on the 7210 and 3510i - maybe the MMAPI? These phones don't support these extensions, so if you try to use them (or even import them without using them) you will get that error.

    shmoove

  3. #3
    Regular Contributor
    Join Date
    Sep 2003
    Location
    Finland
    Posts
    99
    YES I do use MMAPI, but shouldn't it just throw me an exception? I do not import the MMAPI classes, and do not use them at the start of the program, but use them by calling them with the whole package name.

  4. #4
    Super Contributor
    Join Date
    Mar 2003
    Location
    Israel
    Posts
    2,280
    No exception. The problem is that the MMAPI classes do not exist on those devices. And the Java systems don't allow adding classes to the java.* or javax.* package trees which is what the phones think you are trying to do.

    So you will need to make a separate build that has no reference to MMAPI for phones that don't support it.

  5. #5
    Registered User
    Join Date
    Mar 2003
    Location
    Bremen, Germany
    Posts
    106
    Hi Rooster13,

    this might be a solution for you:

    Code:
    package com.company.j2me;
    
    //#if polish.api.mmapi || polish.midp2
    	import javax.microedition.media.*;
    //#endif
    //#if polish.api.nokia-ui
    	import com.nokia.mid.sound.Sound;
    //#endif
    [...]
    
    class MyMidlet extends MIDlet {
    	[...]
    	public void playSound() {
    		//#if polish.api.mmapi || polish.midp2
    			Player player = Manager.createPlayer( openMidiFile(), "audio/midi");
    			[...]
    		//#elif polish.api.nokia-ui
    			// here you could check if the device supports the WAV format
    			// with the preprocessing symbol "polish.audio.wav" by the way...
    			Sound sound = new Sound( loadWavFile(), Sound.FORMAT_WAV );
    			[...]
    		//#else
    			AlertType.INFO.playSound( this.display );
    		//#endif
    	}
    }
    This code assumes that you are using J2ME Polish:
    http://www.j2mepolish.org.

    Best regards,
    Robert

  6. #6
    Registered User
    Join Date
    Jan 2007
    Location
    Manila, Philippines
    Posts
    39

    Unhappy Re: Cannot create class in system package

    any possible turnaround on this....

  7. #7
    Registered User
    Join Date
    Jan 2007
    Location
    Manila, Philippines
    Posts
    39

    Unhappy Re: Cannot create class in system package

    whats the purpose of using some properties (which you can get it system.getProperty) to check if that library is available on the phone

  8. #8
    Registered User
    Join Date
    Mar 2003
    Posts
    4,105
    Have a look at chapter 8 of MSA, nevertheless, I found no other solution than using J2ME Polish for such a device.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×