PDA

View Full Version : Mac Application Developing




Awesomeness
Mar 9, 2009, 01:37 PM
Okay guys, this here be me first post... Anyways, I need HALP! (yes, halp is the new word :)) I don't know what to do... I'm trying to make a compression program in Java. I've finished the PROGRAM, but I have to set the filepath each time in Terminal to run it, I have to run the jar to decompress, (I can't just double click) etc. All this could be fixed by making it into an application.

I've made a compression program in Java and turned it into a jar and put it in the Resources/Java directory, and I've made pritty icons in Photoshop, too! However, I am confuzzled on how to make this evil "Unix Eggsacute-able". (Sorry I like making new words :D) I'm a fearsome 13-year-old developer determined to make my first application, but I also fail to "decrypt" this (also evil) language, "OBJECTIVE C"! -name echoes dramatically-

Anyways, I simply don't understand it. I have made a main function in the jar and everything, and I just need to make the application open the jar. It's path is "Comprezzor.app/Contents/Resources/Java/Comprezzor.jar". I just need to make the Unix Eggsacute-able open this jar and run it's main (Oh, I should probably change main() to something like start(), so that I can call it as a method from the OBJECTIVE C thingy because it probably won't like having a main(), just a guess). However, I have absolutely no idea how to do this! Please help, ASAP

*EDIT*
I've been able to convert the icons to .icns files. So don't complain about the icons being PNG. I've fixed that.

Thanks for your help! (Hopefully someone knows this... :()

PS: I also need to know if my Info.plist is right. It's in the attached files. It wont let me use .plist as the extension so just replace the .txt with .plist. I also want to know how to make it so that when I double-click on a .cmprzz file it knows how to use this. If you know please tell.



wrldwzrd89
Mar 9, 2009, 02:32 PM
This isn't hard at all.

First of all, use Jar Bundler, an application that comes with Mac OS X, to create double-clickable .app packages out of your JARs.

Regarding your second question, this is also easy to do. If you want, you can check out the Info.plist file for my own Java application called Fantastle, which makes use of this functionality on the Mac to register file extensions with applications.

Awesomeness
Mar 9, 2009, 03:11 PM
This isn't hard at all.

First of all, use Jar Bundler, an application that comes with Mac OS X, to create double-clickable .app packages out of your JARs.

Regarding your second question, this is also easy to do. If you want, you can check out the Info.plist file for my own Java application called Fantastle, which makes use of this functionality on the Mac to register file extensions with applications.

How do I download this? I only see an explanation of what it is at the apple developer website.

wrldwzrd89
Mar 9, 2009, 03:30 PM
How do I download this? I only see an explanation of what it is at the apple developer website.
You don't - it comes with Mac OS X, even if you don't install the developer tools. You'll find an alias to it in /Developer/Applications/Utilities.

Awesomeness
Mar 9, 2009, 03:48 PM
You don't - it comes with Mac OS X, even if you don't install the developer tools. You'll find an alias to it in /Developer/Applications/Utilities.
Ok... I've put it in, it don't work! :eek:My jar is in the Java directory which is is the Resources... I don't get it...

Here's the whole log:


Last login: Sun Mar 8 21:07:58 on tty??
/Users/stuart/Documents/Work/Comprezzor/Contents/MacOS/Comprezzor ; exit;
oak:~ stuart$ /Users/stuart/Documents/Work/Comprezzor/Contents/MacOS/Comprezzor ; exit;
[JavaAppLauncher Error] CFBundleCopyResourceURL() failed loading MRJApp.properties file
[JavaAppLauncher Error] CFBundleCopyResourceURL() failed loading MRJApp.properties file
[LaunchRunner Error] No main class specified
[JavaAppLauncher Error] CallStaticVoidMethod() threw an exception
Exception in thread "main" java.lang.NullPointerException
at apple.launcher.LaunchRunner.run(LaunchRunner.java:112)
at apple.launcher.LaunchRunner.callMain(LaunchRunner.java:50)
at apple.launcher.JavaApplicationLauncher.main(JavaApplicationLauncher.java:61)
logout

[Process completed]


It looks like it's saying there's no main() to be found in my jar... BUT THERE IS! It's in one of my classes! HAAAALP!! :confused:

*EDIT*
I renamed JavaApplicationStub to Comprezzor, is that a/the problem?

*EDIT 2*

OH MY GOD IT WORKED! I COULDN'T FIND IT (Java Bundler) UNTIL NOW! I was trying to just copy the JavaApplicationStub instead. YES! Thank you!!!