On January 27th, this site will be read-only as we migrate to Oracle Forums for an improved community experience. You will not be able to initiate activity until January 30th, when you will be able to use this site as normal.

    Forum Stats

  • 3,889,632 Users
  • 2,269,769 Discussions
  • 7,916,800 Comments

Discussions

Could not find or load main class I2CExemple. Can someone help me?

DouglasAlexandre
DouglasAlexandre Member Posts: 12
edited Apr 27, 2015 7:05AM in Java ME Embedded

I'm trying to run a Java ME Embedded application in raspberry pi, using I2C protocols. But when I try to run the command: java -jar I2CExemple, I get an error: Could not find or load main class I2CExemple. Already researched some ways around this error, but I was not successful. Can someone help me?

«1

Answers

  • Sergey.N-Oracle
    Sergey.N-Oracle Member Posts: 99
    edited Apr 20, 2015 5:59AM

    Hi!

    You are unlikely running JavaME Embedded since its binary doesn't contain "java" executable.  Do you mean JavaSE Embedded? If so please ask question in corresponding conference.

    /Sergey

  • DouglasAlexandre
    DouglasAlexandre Member Posts: 12
    edited Apr 20, 2015 10:50AM

    OK, but I'm trying to run an example from Oracle's website: Working with the I2C Bus

    and it says Java ME Embedded 8.1. What am I doing wrong?

  • Sergey.N-Oracle
    Sergey.N-Oracle Member Posts: 99
    edited Apr 20, 2015 11:39AM

    Have you installed JavaME8.1 runtime?  Please note that JavaME requires application to be installed prior to run. Please check how to page

  • DouglasAlexandre
    DouglasAlexandre Member Posts: 12
    edited Apr 20, 2015 1:01PM

    ok, really had no attack for this detail. I'll try! Thaky

    Thank you

  • DouglasAlexandre
    DouglasAlexandre Member Posts: 12
    edited Apr 20, 2015 11:18PM

    Corrects errors for the Java ME Embedded runtime. But I could not even install, the other error!

    [email protected] ~/bin $ ./installMidlet.sh /home/pi/NetBeansProjects/I2CExemple/dist/I2CExemple.jar

    Java is starting. Press Ctrl-C to exit

    Error installing the suite: Reason = 13

    Invalid JAD Exception, reason: 13 (MISSING_SUITE_NAME), message: Reason = 13, extra data: MIDlet-Name

    - com/sun/midp/installer/Installer.checkJarAttributes(), bci=53

    - com/sun/midp/installer/Installer.installStep7(), bci=720

    - com/sun/midp/installer/Installer.performInstall(), bci=147

    - com/sun/midp/installer/Installer.install(), bci=60

    - com/sun/midp/scriptutil/CommandLineInstaller.run(), bci=139

    - java/lang/Thread.run(), bci=5

  • Sergey.N-Oracle
    Sergey.N-Oracle Member Posts: 99
    edited Apr 21, 2015 5:30AM

    Looks like you are unfamiliar with JavaME application and provisioning model. To reduce a number of potential mistakes you can use Netbeans and JavaME-E SDK to create correct application and run sanity check with emulator. And only then connect your RPi board to SDK and install verified application. See SDK how to

  • DouglasAlexandre
    DouglasAlexandre Member Posts: 12
    edited Apr 21, 2015 9:04AM

    Hi, Sergey!

    Sorry for all this work. But I'm using netbeans, use the sdk normally. Already managed to run some examples Java ME Embedded via netbeans, including k64F board too. But this example to use i2c in Raspi is complicated ... lol When I try to run it in sdk happens this:

    TRACE: <at java.lang.NullPointerException>,

    java.lang.NullPointerException

    - com/sun/midp/installer/InstallerCommandHandler.handleGetVersionCommand(), bci=36

    - com/oracle/midp/proxy/ProxyEventListener.handleDeveloperAgentEvent(), bci=814

    - com/oracle/midp/proxy/ProxyEventListener.packetReceived(), bci=10

    - com/oracle/midp/proxy/JavaChannelDispatcher.process(), bci=142

    - com/sun/midp/events/EventQueue.run(), bci=129

    - java/lang/Thread.run(), bci=5

    I do not understand what's wrong. : /

  • Sergey.N-Oracle
    Sergey.N-Oracle Member Posts: 99
    edited Apr 21, 2015 9:16AM

    Hmm, this error indicates problem in SDK GUI-to-runtime channel. Does it happens when you run application with emulator or real device?

  • DouglasAlexandre
    DouglasAlexandre Member Posts: 12
    edited Apr 21, 2015 9:25AM

    This error was generated when running in the emulator. Something corrupted? can be?

  • DouglasAlexandre
    DouglasAlexandre Member Posts: 12
    edited Apr 21, 2015 9:33AM

    When I run the same application, which uses i2c in k64f he performs. But nothing happens with the display of 7 segments.

    Should run the same code on two boards(raspi and k64f) if the display has connected to the correct pins?

This discussion has been closed.