Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ckny

macrumors newbie
Original poster
Dec 4, 2006
26
3
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.
 

pilotError

macrumors 68020
Apr 12, 2006
2,237
4
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.

Mike...
 

jeremy.king

macrumors 603
Jul 23, 2002
5,479
1
Holly Springs, NC
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.

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")
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.