New to Java on Mac... Help compiling?

Discussion in 'Mac Programming' started by ckny, Dec 4, 2006.

  1. ckny macrumors newbie

    Dec 4, 2006
    Hello everyone, I'm hoping someone can point me to some resources that might help out. I have a bit of programming experience on Windows (mostly vb + c) and a small amount of Java specific programming. I've never tried programming in the mac environment though.

    Here's the situation. Someone has created a windows executable through java programming that I wanted to use on a mac (g5). I asked for the java source to try to convert it for a mac program. I now have 3 java files and the corresponding class files.

    Now what? How can I compile these into a .jar or .app file? I tried javac through the terminal and I get errors in two of the java files. Will java which works on Windows automatically work on the mac or will the code need tweaking? The program is basically a file parser. It opens a file, parses information, and outputs a new file.

    Any help would be great. Thanks.
  2. pilotError macrumors 68020


    Apr 12, 2006
    Long Island
    If your doing file stuff, you might want to look through the code and check for directory paths and such.

    Windows uses a '\' (backslash) while Unix (OS X) uses a '/' forward slash for directory path information. OS X doesn't have the concept of a drive and other little ditties like that.

    Depending on how he coded it, you might be able to get away with it. Its hard to know whats wrong without some code snippets and some specific errors that you got during the compile.

    Theoretically, if you have the .class files, you should be able to execute them without recompiling.

  3. jeremy.king macrumors 603


    Jul 23, 2002
    Fuquay Varina, NC
    Yes, yes...please give us the error messages.

    Also, don't put a "/" in the code either if you decide to tweak it. Instead you should use File.separator or System.getProperty("file.separator")

Share This Page