Java Cell phone programming problems.

Discussion in 'Mac Programming' started by helgimar, Feb 28, 2009.

  1. macrumors newbie

    Joined:
    Feb 28, 2009
    #1
    Hi

    I am editing a java Cell phone game for my class.
    I have no idea how to compile the .java files. Can someone please inform me how to do that, or compile them and send them back to me?

    On the other hand, I have to put a timer on the program.
    It has to take the time it takes to finish the puzzle, and then put your time on the high score list (which doesn't exit)

    I also can't find where to change the name of the game, on my phone the name is Jigsawislam but I want it to be Púslið

    Can someone incorporate that into my attached files?

    Thanks.
     

    Attached Files:

  2. macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
    #2
    We will not do your homework for you.
    javac filename.java
    Will build filename.class from filename.java. The rest is your assignment. You can ask questions about an approach or snippit of code, but not "do my homework".

    -Lee
     
  3. thread starter macrumors newbie

    Joined:
    Feb 28, 2009
    #3
    Thats the problem, JAVAC does not work!
    I have tried it in both my mac and my PC and it won't compile for me.
    In my PC it gives me 49 errors per file or something.

    and I have no Idea how to compile java files on MAC.
     
  4. macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
    #4
    Did your teacher/professor not provide you instructions on building this project? It looks like there are J2ME/MIDP dependencies required. I downloaded a version for OS X from here:
    http://mpowers.net/midp-osx/

    I added the classes directory from there to my classpath, and tried to compile. c.java would compile. I got stuck after that, but I may just not know how to handle cross-dependencies in Java. d.java references JigsawIslam.java, and vice-versa. a.java references JigsawIslam.java, and b.java references d.java and JigsawIslam.java. It may be possible to build a project with these kinds of dependencies, but I just don't know how to do it.

    Is this "known-good" code that was given to you, or did you write most of it? If the prior, were there instructions to build the project?

    -Lee
     
  5. Wes
    macrumors 68020

    Wes

    Joined:
    Jun 22, 2001
    Location:
    London
    #5
    Doing a javac *.java should be enough to handle all the dependencies for you. Whoever wrote this code doesn't have particularly java'ish style, seemed very C! I guess this is is a by-product of it being java micro edition but still, not a fan of the code.
     
  6. thread starter macrumors newbie

    Joined:
    Feb 28, 2009
    #6
    Hi Guys,

    No actually this is just a .jar file, that has been decompiled and edited.
    I was just supposed to translate all the text to my language and than compile it again.

    I changed the text but can't compile again, I tried compiling it in my PC and just got loads of errors...
     
  7. macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
    #7
    I figured, and that's what i tried. The code is nigh unreadable, so i got a bit confused with what the compiler was complaining about. There are classes called a,b,c,d, and local variables called the same thing, etc. I guess this is what a decompiler gets you? I would try renaming at LEAST the classes, if not all of the local variables, to something reasonable. Otherwise there is a lot of complaining. I just went for the local variable route, and it seemed to work... in so far as the classes were compiled. I changed all of the locally declared things called a,b,c, or d to old_X where X is the original value, then let the compiler tell me what other lines needed to change.

    I have no idea if these things would work now... but they at least compiled after this.

    I don't understand what this class is trying to teach, exactly... if it's a reverse engineering course, i would think warnings about the decompilers would have been issued clearly. If it's about writing games or something, I don't know why decompiling and translating would be part of it. One way or the other, this seems fixable, it will just take a few minutes of work renaming some variables or the classes.

    -Lee
     

Share This Page