Java on FRDM K64F board

Some interesting news:
https://terrencebarr.wordpress.com/2014/09/28/now-available-java-me-8-1-in-190-kb-ram/
Regards,
Piotr

Hi Alexander.
Thanks for the reply. It was really really fast
Do you know any board that uses Cortex-M4 and runs JavaME? But not as expensive as a Keil MCBSTM32F400.
Marco.

Similar Messages

  • Java ME on Freescale FRDM-K64F board

    Hi.
    I have a Freescale FRDM-K64F board and I'd like to know how to install the JavaME on it. Freescale doesn't has a Java dev kit, but it's a Cortex-M4.
    Have you ever tried something with this board or maybe have some clue?
    Regards.

    Hi Alexander.
    Thanks for the reply. It was really really fast
    Do you know any board that uses Cortex-M4 and runs JavaME? But not as expensive as a Keil MCBSTM32F400.
    Marco.

  • Proxy client (over USB connection) with DHCP assigned IP address doesn't work with FRDM-K64F

    Hello,
    after reading about the issues on this forum with a static IP address on the Freescale FRDM-K64F board I went for an DHCP address but I can't get the proxy client to work over a USB connection with DHCP either.
    My console tells me the following:
    RTC Time: Wed 2014-01-01 00:07:27
    Network initialized
    IP Address:      10.143.xxx.yyy (xxx and yyy is real numbers, just changing them for the forum to letters)
    Subnet mask:     255.255.252.0
    Gateway:         10.143.xxx.yyy
    MAC-address:     00:0c:00:06:70:00
    And when I try o to connect with the following command :
    java -jar proxy.jar -socket 10.143.xxx.yyy
    I get the following output and no CLI interface:
    Trying to open socket connection with device: 10.143.xxx.yyy:2201
    Connected to the socket: Socket[addr=/10.143.xxx.yyy,port=2201,localport=49605]
    Open channel 8 with hash 0x130399b3
    Channel 8 CLOSED -> OPENED
    notifyResponse AVAILABLE_RESPONSE on channel 8
    Channel 8 OPENED -> AVAILABLE
    Open channel 9 with hash 0x0
    Channel 8 AVAILABLE -> REQUEST_SENT
    notifyResponse ACK_RESPONSE on channel 8
    Channel 8 REQUEST_SENT -> ACKNOWLEDGED
    Channel 8 ACKNOWLEDGED -> DATA_SENT
    notifyResponse AVAILABLE_RESPONSE on channel 8
    Channel 8 DATA_SENT -> AVAILABLE
    Channel 8 AVAILABLE -> REQUEST_SENT
    notifyResponse ACK_RESPONSE on channel 8
    Channel 8 REQUEST_SENT -> ACKNOWLEDGED
    Channel 8 ACKNOWLEDGED -> DATA_SENT
    notifyResponse AVAILABLE_RESPONSE on channel 8
    Channel 8 DATA_SENT -> AVAILABLE
    Channel 8 AVAILABLE -> REQUEST_SENT
    notifyResponse ACK_RESPONSE on channel 8
    Channel 8 REQUEST_SENT -> ACKNOWLEDGED
    Channel 8 ACKNOWLEDGED -> DATA_SENT
    notifyResponse AVAILABLE_RESPONSE on channel 8
    Channel 8 DATA_SENT -> AVAILABLE
    Channel 8 AVAILABLE -> REQUEST_SENT
    notifyResponse ACK_RESPONSE on channel 8
    Channel 8 REQUEST_SENT -> ACKNOWLEDGED
    Channel 8 ACKNOWLEDGED -> DATA_SENT
    notifyResponse AVAILABLE_RESPONSE on channel 8
    Channel 8 DATA_SENT -> AVAILABLE
    Channel 8 AVAILABLE -> REQUEST_SENT
    notifyResponse ACK_RESPONSE on channel 8
    Channel 8 REQUEST_SENT -> ACKNOWLEDGED
    Channel 8 ACKNOWLEDGED -> DATA_SENT
    notifyResponse AVAILABLE_RESPONSE on channel 8
    Channel 8 DATA_SENT -> AVAILABLE
    Channel 8 AVAILABLE -> REQUEST_SENT
    notifyResponse ACK_RESPONSE on channel 8
    Channel 8 REQUEST_SENT -> ACKNOWLEDGED
    Channel 8 ACKNOWLEDGED -> DATA_SENT
    notifyResponse AVAILABLE_RESPONSE on channel 8
    Channel 8 DATA_SENT -> AVAILABLE
    Channel 8 AVAILABLE -> REQUEST_SENT
    notifyResponse ACK_RESPONSE on channel 8
    Channel 8 REQUEST_SENT -> ACKNOWLEDGED
    Channel 8 ACKNOWLEDGED -> DATA_SENT
    notifyResponse AVAILABLE_RESPONSE on channel 8
    Channel 8 DATA_SENT -> AVAILABLE
    Channel 8 AVAILABLE -> REQUEST_SENT
    notifyResponse ACK_RESPONSE on channel 8
    Channel 8 REQUEST_SENT -> ACKNOWLEDGED
    Channel 8 ACKNOWLEDGED -> DATA_SENT
    notifyResponse AVAILABLE_RESPONSE on channel 8
    Channel 8 DATA_SENT -> AVAILABLE
    I don't know if this matter but my java version is:
    java version "1.8.0_31"
    Java(TM) SE Runtime Environment (build 1.8.0_31-b13)
    Java HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode)
    Any ideas or am I missing something completely?
    Thanks
    Andy

    Hi, Andy. Please excuse my ignorance, I am very new at this ME embedded stuff. I had my challenges, but was finally able to get my board up with a static address. I went through a lot of headaches, but finally got the board flashed with the latest bin. I then updated the jwc_properties.ini file on the SD card to include:
    # Whether static configuration or DHCP server is used do get IP address. Possible values: dhcp,static
    ip.method = static
    # IP address,used with static IP configuration only
    ip.addr = 192.168.0.30
    # Network mask,used with static IP configuration only
    ip.netmask = 255.255.255.0
    # Network gateway,used with static IP configuration only
    ip.gateway = 192.168.0.1
    # DNS server,used with static IP configuration only
    ip.dns = 208.67.222.222
    # MAC address
    mac.addr = 01:02:03:04:05:06
    I was then put the card into the board, disconnected both USB cables, and then powered it up. From that point I was able to ping the board. I can now use Device Manager in NetBeans to connect to the device.
    I am struggling quite a bit with many issues. It seems that when I try to stop the app from NetBeans, the "please wait" dialog hangs forever. I have to use Windows Task Manager to kill the "JavaW" process tree and reconnect the board.
    I have also had trouble understanding the GPIO pin assignments. Another gotcha was trying to use the AutoStart feature. Since the sample app never cleanly exited, I thought that I bricked the board. The secret is to power it down, remove the SD card, and then delete all files EXCEPT the jwc_properties.ini file, put the SD card back in, then power up. It seems that the board forgets that the MIDlet was installed.
    Hope this helps others out there.
    Please everybody, post your experiences here. There seem to be very few of us, and finding pearls in the dust is rare right now.
    Regards,
    Pete

  • Form-factor of Arduino R3 pin layout on FRDM-K64F

    Hello,
    I have just got my FRDM-K64F board and I'd like to add a few sensors to it to test it out. I've read that the board has a form-factor of Arduino™ R3 pin layout and I am not sure what that means when I am buying sensors (i2C, SPI, UART interfaces) for this board. I understand that I can just connect any sensor using a breadboard and cables but I was thinking that maybe this Arduino R3 pin layout is something that makes it easier?
    As you probably can see, my HW skills a nothing to brag about....
    Many Thanks
    Andy

    Hi Andy,
    we've experienced the board with GSM modem arduino shield without any problem. You only need to check revision of your board since one of the first version contains a bug with incorrect pin routing that affects I2C (or SPI I don't remember)
    /Sergey

  • Freescale FRDM-K64F

    Now Java ME 8.1 SDK is available i started with installing it on my Freescale FRDM-K64F.
    I try to install Java ME on this device (I suppose this installs on the micro-sd card), but I don’t see anything appearing on the micro-sd card; is this normal? I followed the procedure in https://docs.oracle.com/javame/8.1/get-started-freescale-k64/install.htm#BABCHEEA
    Thanks.
    Guy

    Hi Guy, Sergey,
    You could do that, but that is optional. That is, if you don't want to change any of the properties from their default values (those are in stock jwc_properties.ini) you don't need to put the file on sd_card. In this case JMEE will use the romized (built into executable image) version of the file.
    Another thing is that on K64 the image of JMEE is written into on-chip flash. So it does not appear on sd_card as a result of pressing the "Flash" button
    Regards,
    Andrey

  • Freescale FRDM-K64F sending data over CANBUS.....

    I have setup J2ME embedded 8.1 on the FRDM-K64F. I was able to work with reconfigured GPIO  and access the accelerometer via I2C.
    How do you initialize and send data using CAN interface on the FRDM-K64F?

    To clearify for me, Are you stating the J2ME (at this time) can not use the CAN feature on frdm-k64f.....
    http://developer.mbed.org/platforms/frdm-k64f/

  • SDcard for FRDM-K64F?

    Hi
    Have followed all the instructions, however the response from the serial port is:
    No disk, or could not put SD card in to SPI idle state
    Didn't get a response from the disk
    Set 512-byte block timed out
    configdb_load_to_db error: Unable to open file, trying to recover from the temporal one
    configdb_load_to_db error: temporal settings file is unavailable
    ERROR: Unable to read configuration file(s).  Check that ini file(s) exists in your application directory.
    Have used the MBED sample code for the board: FTF2014_workshop - | mbed and the SD card reads and writes ok, so the card slot works.
    I have both 2gb & 4gb SDcards, they seem to work with other boards.
    Any special formatting or setup needed?
    I've not been able to get the virtual serial port working either.....
    thanks for any suggestions
    gb

    Hi
    Yes, I have the Java folder as the root, with just the .ini file inside that.
    It looks like SDcard access with Mbed type devices can be a bit tricky, probably just need to try some different cards?
    Mine are both Sandisk....
    with thanks
    gb

  • Java Error in discussion boards

    I was trying to click the link in an online discussion board for my class, and the bottom left corner of the browser says, " void(showMessage('serve_bulletin?ARTICLE+Main+262')). And the 262 is just a number for the link. Why can't I access the link?
    Jarred

    The question mark (?) in the URL most likely indicates that the server is sending dynamic content. You most likely will not simply be able to look at the URL after the question mark as the interpretation will be software dependent.
    - Saish
    "My karma ran over your dogma." - Anon

  • FRDM-K64F set the realtime clock from code?

    Hi, all!
    I have read the docs about rtc.time in the jwc_properties.ini file. This works ok when installing, but when the device resets or power is cycled, the clock will be incorrect. Since my app is communicating with a server, it would be simple to get the current datetime from the server. But I have not found any way to set the current clock other than the jwc_properties.ini file. Is there a way I can do this in my app? Or can my app write to the jwc_properties.ini file and then restart itself?
    Thanks!

    Hi!
    Actually you can change the value of the property using the following method:
    Settings.setStringProperty("rtc.time", "2016:01:01:00:00:00");
    Your application shall exit after invoking this line in order for the property to be written into the file. Please note that the rtc is only updated from the property during power-up or reset of the MCU. So that the new time is not applied when your application restarts, you need to force MCU to restart. And because Java APIs are limited on k64 there seem to be no way to initiate that from the application
    Regards,
    Andrey

  • K64F JavaME 8.1 - programming in C

    I would like to combine Java and C programming on FRDM K64F board.
    Any suggestions are welcome.
    Regards,
    Piotr

    The goal of Java ME Embedded 8 on the FRDM-K64F is to cover most use cases directly in Java - such as interacting with hardware, etc (use DIO API, for example).
    Developing and running additional user C or native code alongside or integrated with Java ME Embedded 8 isn't supported 'out of the box' for a couple of reasons, such as limitations of the mbed OS (static linking, no support for loadable applications) as well as considerations related to reliability, platform-independence, and compliance on the Java side (3rd party native code can negatively affect the overall system and needs to be handled appropriately).
    It is certainly possible to integrate project-specific native code into the Java ME runtime but that requires a different development and delivery model (as part of the Oracle Java Platform Integrator program) - let me know if you're interested in discussing that.
    Best,
    -- Terrence

  • Q:Micro SD card for FRDM-K64

    Hello,
    I am installing Java ME 8.1 on my FRDM-K64 board and according to the installation guide I need a Micro SD card of 4GB (using a SDHC card is not recommended). I am really struggling finding such a card, maybe someone knows where to buy one. I have searched RadioShack, BestBuy and Frys with no luck. Will it work with a bigger card?
    Thanks
    Andy

    Yes, Andy, they're virtually impossible to find.
    The non-HC design is an older technology.
    Vague memory (and I'm not going to look it up beyond a generic Google search) is that the two cards have a different density structure.
    I came across this same sort of issue a couple of years ago with a no-name MP3 player  --> SD worked while SDHC failed.
    As I type this, Newegg's web site has three and only three available for sale.
    Microcenter's web site and TigerDirect's web site each have a few available in the USA (your reference to Radio Shack suggests you are there).
    Other people will need to respond to let you knoe whether a HC card will function.   I have no knowledge on that.

  • FAQ: failed to connect to the Java on Raspberry

    Frequently people have issues connecting development (Netbeans, ME SDK, device manager, etc) host with Java on the RPi board. There might be multiple reasons for that. I'll try to list known causes and the ways to fix them
    Typically the problems shows itself like:
    EmbeddedExternalDevice1 is not present in Netbeans project configuration/Platform dialog
    Device manager (in windows tray) shows device connection status as "Connecting"
    Running the project or ME SDK (emulator.exe -Xjam) does not open ME SDK window
    Attempt to run project opens ME SDK window but application installation never completes
    The trivial things to verify are:
    First of all check that IP connectivity with the board (e.g. ping the board IP)
    Ensure you have Java started on the board ("sudo ./usertest.sh")
    RPi board IP shall be added to device manager (icon in tray) as an address to connect to
    Make sure you have only one instance of ME SDK connected with one Java ME runtime/RPi board (e.g. form multiple PCs). Note that Java ME will allow for mutliple connections but all of these connections will be unstable and unusable
    If all the above is good but you still have the problem there seem to be more serious issue
    Check that you have ME runtime and ME SDK of exactly the same version ("8.0 GA", "8.1 EA" or "latest developer build". In the latter case the "latest build" shall have exactly the same number). The versions must mach exactly. If not sure - download again and reinstall
    Latest Netbeans is suggested as well. Please note that current Netbeans 8.0 is not fully ME8-ready. The full ME8 support will appear a bit later in Netbeans 8.0 patch 2 release
    Check that you have proper permissions for all ME runtime files on RPi (sometimes even running under sudo does not help to read some files, e.g. on network mounted drives)
    If you have updated ME SDK please make sure to stop device manager (from tray icon) and remove it's work dir (c:/Users/<user>/javame-sdk) and start emulator.exe (without parameters)
    Please note that if you run proxy.jar manually (skip this step if you don't know what it is) you have to have no instance of ME SDK connected to the RPi. Or alternatively if you connect ME SDK you shall have no proxy.jar manually started
    If nothing of the above helps please do the following:
    Stop device manager (using icon in windows tray)
    Delete c:/Users/<user>/javame-sdk
    Start device manager (e.g. by running emulator.exe)
    Try to connect
    Post here your c:\Users\<user>\javame-sdk\8.0\log\device-manager.log and c:\Users\<user>\javame-sdk\8.0\work\EmbeddedExternalDevice1\device.log (if any)
    I'll add more hints here along the way
    Regards,
    Andrey

    Hi Andrey,
    Connection to the RPi is intermittent. There are several exceptions in the logs.
    I have attached the log files. I have a wired and a wireless connection to the RPi.
    1. I ping the RPi from my PC - fine
    2. I can see tthe RPi IP address registered in the device manager - fine.
    3. I run the example, the AMS window opens and an error dialog pops up saying "Connection lost to the device".
    Also, I have trouble SSH ing to the RPi sometimes. The wired works fine but the wireless is the issue.
    Can you please help.
    Thanks.

  • I still cant get my head around this:  java.lang.NullPointerException

    heres my disgusting amount of code and its error report. please help. its basically the board for a twixt game. if you dont know what that is its not important because the error has nothing to do with the rules of the game.
    Exception in thread "main" java.lang.NullPointerException
         at Board.pcomp(Board.java:81)
         at Board.addremovebridge(Board.java:34)
         at Twixt.main(Twixt.java:21)
    Thanks again for reading this far.
    public class Twixt {
         public static void main(String[] args) {
              Board game = new Board();
              point p = new point();
              p.x = 4;
              p.y = 4;
              p.p = 1;
              point f = new point();
              f.x = 5;
              f.y = 6;
              p.p = 1;
              String s = new String();
              s = game.placetower(p);
              s = game.placetower(p);
              System.out.println(s);
              s = game.placetower(f);
              System.out.println(s);
              s = game.addremovebridge(p,f);
              System.out.println(s);
              s = game.addremovebridge(p,f);
              System.out.println(s);
    public class point {
         int x = 0;
         int y = 0;
         int p = 0;
    import java.lang.Math;
    public class Board{
         public int[][] board1 = new int[26][26];
         public point[][][] board2 = new point[26][26][6];
         private int board3d;
         private int board3e;
         /*Board() {
              for(int x = 0; x<=25; x++){
                   for(int i = 0; i<=25; i++){
                        for(int j = 0; j<=6;j++){
                             pmakezero(board2[x][j]);
         public String placetower(point d){
              if (board1[d.x][d.y] == 0){
                   board1[d.x][d.y] = d.p;
                   return ("Tower placed at "+d.x+", "+d.y+".");
              }else{
                   return ("That space is already taken.");
         public String addremovebridge(point d, point e){
              if(checkplayer(d,e)){
                   boolean removebridge = false;
                   for(int i = 0; i<=5;i++){
                        if(pcomp(board2[d.x][d.y][i], e)){
                             pmakezero(board2[d.x][d.y][i]);
                             removebridge = true;
                        if(pcomp(board2[e.x][e.y][i], d)){
                             pmakezero(board2[e.x][e.y][i]);
                             removebridge = true;
                   if(distance(d,e)&&!intersect(d,e)&&!removebridge&&!full(d,e)){
                        board2[d.x][d.y][board3d] = e;
                        board2[e.x][e.y][board3e] = d;
                        return ("Bridge placed between "+d.x+", "+d.y+" and "+e.x+", "+e.y+".");
                   }else{
                        return ("That is not a valid bridge placement.");
              }else{
                   return ("That tower does not belong to you.");
         private boolean distance(point d, point e){
              double g;
              int f;
              int i;
              f = d.x - e.x;
              i = d.y - e.y;
              f = f*f;
              i = i*i;
              f = f+i;
              g = f;
              if (g>0){
                   g = g * -1;
              g = Math.sqrt(g);
              if(g == Math.sqrt(5)){
                   return true;
              }else{
                   return false;
         private boolean pcomp(point d, point e){
              if(d.x == e.x && d.y == e.y){
                   return true;
              }else{
                   return false;
         private void pmakezero(point d){
              d.x = 0;
              d.y = 0;
              d.p = 0;
         private boolean checkplayer(point d, point e){
              if(board1[d.x][d.y] == d.p && board1[e.x][e.y]==e.p){
                   return true;
              }else{
                   return false;
         private boolean full(point d, point e){
              point x;
              int y;
              int z;
              boolean full = true;
              for(int i=0; i<=5; i++){
                   x = board2[d.x][d.y][i];
                   y = x.x;
                   z = x.y;
                   if(y == 0 && z == 0){
                        board3d = i;
                        i = 3;
                        full = false;
              for(int i=0; i<=3; i++){
                   x = board2[e.x][e.y][i];
                   y = x.x;
                   z = x.y;
                   if(y == 0 && z == 0){
                        board3e = i;
                        i = 3;
                        full = false;
              return full;
         private boolean intersect(point d, point e){
              boolean inter = false;
              int f;
              int h;
              f = d.x - e.x;
              h = d.y - e.y;
              if(f == 2 && h == 1){
                   if(board1[e.x + 1][e.y]!=0){
                        for(int w=0;w<=5;w++){
                             if(board2[e.x + 2][e.y + 2][w]==e){
                                  inter = true;
                             }else if(board2[e.x][e.y + 2][w]==e){
                                  inter = true;
                   }else if(board1[d.x - 1][d.y]!=0){
                        for(int w=0;w<=5;w++){
                             if(board2[d.x - 2][d.y - 2][w]==d){
                                  inter = true;
                             }else if(board2[d.x][d.y - 2][w]==d){
                                  inter = true;
                   }else if(board1[e.x + 2][e.y]!=0){
                        for(int w=0;w<=5;w++){
                             if(board2[e.x + 1][e.y + 2][w]==e){
                                  inter = true;
                   }else if(board1[d.x - 2][d.y]!=0){
                        for(int w=0;w<=5;w++){
                             if(board2[d.x - 1][d.y - 2][w]==d){
                                  inter = true;
              }else if(f == -2 && h == -1){
                   if(board1[e.x - 1][e.y]!=0){
                        for(int w=0;w<=5;w++){
                             if(board2[e.x - 2][e.y - 2][w]==e){
                                  inter = true;
                             }else if(board2[e.x][e.y - 2][w]==e){
                                  inter = true;
                   }else if(board1[d.x + 1][d.y]!=0){
                        for(int w=0;w<=5;w++){
                             if(board2[d.x + 2][d.y + 2][w]==d){
                                  inter = true;
                             }else if(board2[d.x][d.y + 2][w]==d){
                                  inter = true;
                   }else if(board1[e.x - 2][e.y]!=0){
                        for(int w=0;w<=5;w++){
                             if(board2[e.x - 1][e.y - 2][w]==e){
                                  inter = true;
                   }else if(board1[d.x + 2][d.y]!=0){
                        for(int w=0;w<=5;w++){
                             if(board2[d.x + 1][d.y + 2][w]==d){
                                  inter = true;
              }else if(f == 1 && h == 2){
                   if(board1[e.x][e.y + 1]!=0){
                        for(int w=0;w<=5;w++){
                             if(board2[e.x + 2][e.y + 2][w]==e){
                                  inter = true;
                             }else if(board2[e.x + 2][e.y][w]==e){
                                  inter = true;
                   }else if(board1[d.x][d.y - 1]!=0){
                        for(int w=0;w<=5;w++){
                             if(board2[d.x - 2][d.y - 2][w]==d){
                                  inter = true;
                             }else if(board2[d.x - 2][d.y][w]==d){
                                  inter = true;
                   }else if(board1[e.x][e.y + 2]!=0){
                        for(int w=0;w<=5;w++){
                             if(board2[e.x + 2][e.y + 1][w]==e){
                                  inter = true;
                   }else if(board1[d.x][d.y - 2]!=0){
                        for(int w=0;w<=5;w++){
                             if(board2[d.x - 2][d.y - 1][w]==d){
                                  inter = true;
              }else if(f == -1 && h == -2){
                   if(board1[e.x][e.y - 1]!=0){
                        for(int w=0;w<=5;w++){
                             if(board2[e.x - 2][e.y - 2][w]==e){
                                  inter = true;
                             }else if(board2[e.x - 2][e.y][w]==e){
                                  inter = true;
                   }else if(board1[d.x][d.y + 1]!=0){
                        for(int w=0;w<=5;w++){
                             if(board2[d.x + 2][d.y + 2][w]==d){
                                  inter = true;
                             }else if(board2[d.x + 2][d.y][w]==d){
                                  inter = true;
                   }else if(board1[e.x][e.y - 2]!=0){
                        for(int w=0;w<=5;w++){
                             if(board2[e.x - 2][e.y - 1][w]==e){
                                  inter = true;
                   }else if(board1[d.x][d.y + 2]!=0){
                        for(int w=0;w<=5;w++){
                             if(board2[d.x + 2][d.y + 1][w]==d){
                                  inter = true;
              return inter;
    Thank you.

    Exception in thread "main"
    java.lang.NullPointerException
         at Board.pcomp(Board.java:81)
         at Board.addremovebridge(Board.java:34)
         at Twixt.main(Twixt.java:21)
    So the null pointer occurs on the 81st line in the Board.java source code file. I'm not sure, but I expect this is line 81.if(d.x == e.x && d.y == e.y){Here's one way to troubleshoot null pointer problems. First find the line causing the error. Then, use System.out.println() statements to display the values of all the reference variables in that line, one variable at a time. So if I guessed correctly on line 81, you would put these statements just before line 81System.out.println("d " + d);
    System.out.println("e " + e);Because d and e are the only reference variables in that line. When you run the code after putting these lines in, one or both of these will display "null" and that will tell you which variable to trace. You will need to trace backward through your code a find out why d or e or both are null.
    (hint: A statement like Object[] objects = new Object[10];" creates an Object array with 10 elements, each of which is null. You have to use "objects[1] = new Object();" to create an element in the array which is an Object.)

  • Application works from NB but not from jar

    Hi,
    I'am programming a game in JAVA and this going as planned. Everything works when I run it from NetBeans, but when I execute the jar file from the console, then I get hunderds of the same exception.
    I really don't know what it is, I see a NoSuchMethod exception in the MouseEvent of the method getLocationOnScreen(), but just as i said, the app works fine without errors from out NB.
    Does somebody knows what the problem is?
    thx Sven
    java -jar Hotel.jar
    Loading board images.
    Loading image: /Images/bg-patern-hotel.jpg
    Opening file /Images/bg-patern-hotel.jpg file exisits: true -- [/Users/svenvanzoelen/NetBeansProjects/Games/Hotel/dist/Images/bg-patern-hotel.jpg]
    Loading image: /Images/Main-board-big.jpg
    Opening file /Images/Main-board-big.jpg file exisits: true -- [/Users/svenvanzoelen/NetBeansProjects/Games/Hotel/dist/Images/Main-board-big.jpg]
    Exception in thread "AWT-EventQueue-0" java.lang.NoSuchMethodError: java.awt.event.MouseEvent.getLocationOnScreen()Ljava/awt/Point;
         at Engine.GameAction.setMousePos(GameAction.java:137)
         at Engine.InputManager.mouseMoved(InputManager.java:277)
         at java.awt.Component.processMouseMotionEvent(Component.java:5647)
         at java.awt.Component.processEvent(Component.java:5371)
         at java.awt.Container.processEvent(Container.java:2010)
         at java.awt.Window.processEvent(Window.java:1184)
         at java.awt.Component.dispatchEventImpl(Component.java:4068)
         at java.awt.Container.dispatchEventImpl(Container.java:2068)
         at java.awt.Window.dispatchEventImpl(Window.java:1801)
         at java.awt.Component.dispatchEvent(Component.java:3903)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    Same error goes 50 times more.Edited by: Svenmeister on Apr 16, 2010 7:22 AM
    Edited by: Svenmeister on Apr 16, 2010 7:22 AM

    Ok, I updated my Mac but still got the 1.5.0_22 crap so I changed the function from the mouseEvent to one that 1.5 supports.
    But now when I run the application from the console the Exception about the mouse function is gone, but I got another exception instead of it. And this one is I believe not JRE version relevant.
    The error is in the loading of the images, at the third PNG image to be precise. The images are now in total 10.8MB in size.
    So is this also a 1.6 thing? Would be awesome if someone can explain it.
    java -jar Hotel.jar Loading board images.
    Exception in thread "Image Fetcher 0" java.lang.OutOfMemoryError: Java heap space
         at java.awt.image.DataBufferInt.<init>(DataBufferInt.java:41)
         at java.awt.image.Raster.createPackedRaster(Raster.java:458)
         at java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:1015)
         at sun.awt.image.ImageRepresentation.createBufferedImage(ImageRepresentation.java:223)
         at sun.awt.image.ImageRepresentation.setPixels(ImageRepresentation.java:469)
         at apple.awt.OSXImageRepresentation.setPixels(OSXImageRepresentation.java:66)
         at sun.awt.image.ImageDecoder.setPixels(ImageDecoder.java:120)
         at sun.awt.image.PNGImageDecoder.sendPixels(PNGImageDecoder.java:498)
         at sun.awt.image.PNGImageDecoder.produceImage(PNGImageDecoder.java:419)
         at sun.awt.image.InputStreamImageSource.doFetch(InputStreamImageSource.java:246)
         at sun.awt.image.ImageFetcher.fetchloop(ImageFetcher.java:172)
         at sun.awt.image.ImageFetcher.run(ImageFetcher.java:136)
    Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
         at java.awt.image.DataBufferInt.<init>(DataBufferInt.java:41)
         at java.awt.image.Raster.createPackedRaster(Raster.java:458)
         at java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:1015)
         at java.awt.image.BufferedImage.<init>(BufferedImage.java:345)
         at apple.awt.CGraphicsConfig.createCompatibleImage(CGraphicsConfig.java:174)
         at GUI.Board.toBufferedImage(Board.java:1472)
         at GUI.Board.loadImages(Board.java:1143)
         at Engine.HotelMain.switchState(HotelMain.java:86)
         at Engine.HotelMain.<init>(HotelMain.java:57)
         at Engine.HotelMain.main(HotelMain.java:194)Edited by: Svenmeister on Apr 16, 2010 11:01 AM

  • HT1541 i still cant get my code

    i still can't get my code

    Exception in thread "main"
    java.lang.NullPointerException
         at Board.pcomp(Board.java:81)
         at Board.addremovebridge(Board.java:34)
         at Twixt.main(Twixt.java:21)
    So the null pointer occurs on the 81st line in the Board.java source code file. I'm not sure, but I expect this is line 81.if(d.x == e.x && d.y == e.y){Here's one way to troubleshoot null pointer problems. First find the line causing the error. Then, use System.out.println() statements to display the values of all the reference variables in that line, one variable at a time. So if I guessed correctly on line 81, you would put these statements just before line 81System.out.println("d " + d);
    System.out.println("e " + e);Because d and e are the only reference variables in that line. When you run the code after putting these lines in, one or both of these will display "null" and that will tell you which variable to trace. You will need to trace backward through your code a find out why d or e or both are null.
    (hint: A statement like Object[] objects = new Object[10];" creates an Object array with 10 elements, each of which is null. You have to use "objects[1] = new Object();" to create an element in the array which is an Object.)

Maybe you are looking for

  • Hyper-V host crash and live migration - what happens?

    Hello there, it would be great if you could help me understand how live migrationworks on a sudden host crash of a cluster node. I know that the cluster functionality mounts the vhd file on another host and runs the VM. But what happens to the VM its

  • Trouble with Power Supply

     have a question, my mainboard is a KT3 Ultra-ARU and I just got a Antec TruePower 480W power supply and this power supply comes with a 3pin sensor and I connected this sensor to my mainboard but it does not show the speed, what can I do. I have also

  • Journal ledger Report

    HI What is the general ledger report t/code, to see the all the line items what we have been posted from 1st Feb to 31st march 2009. Regards, Prabhakar

  • Help! PPT to Mov to MPEG-No Sound

    I've converted my powerpoint a movie file and then an mpeg file using qt pro. The picture comes in great but my sound is terrible! How do I fix this? Any help would be wonderful!

  • Full signal strength but unable to connect to the internet

    I just got my ibook G4 about a month ago and have only been able to access the internet for about 2 weeks on and off. After I set up my wireless linksys router I was able to connect right away and it was fine. Then about a week or so after using it w