Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Making a Mac double-clickable application in NetBeans

Tags:

macos

I have recently moved to a MacBook Pro, which has meant leaving my beloved JBuilder 2005 behind. Since there is no such thing any more (AFAIK) as a free JBuilder, I'm having to choose a new IDE.

I can't live with the code-formatting of Eclipse (yes, I know, it can be customised up the wazoo, but the fact that it will NOT respect my inserted returns means I can't live with it) so I'm seriously considering NetBeans.

However, I can't find any way of getting it to build a double-clickable Mac application! (I used to use XCode for this step, but it seems that XCode no longer wants to know about Java...) I cannot be the first person who's wanted to do this...can anyone help me with advice as to how to go about it?

Grateful thanks in advance

like image 606
skiaddict1 Avatar asked Nov 14 '22 11:11

skiaddict1


1 Answers

I had a similar issue and have moved to using Netbeans with the AppBuilder tool. Of course you need to make sure you install the latest version of the Java SDK. http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/packagingAppsForMac.html

I also did some tweaking to the Ant build.xml file so I never have to modify it and can just copy it between projects. A nice modification I added also auto builds the .app file from within the IDE during a clean compile.

<target depends="wine-version" name="-post-jar" description="Run OSX AppBundler.">
    <bundleapp 
        name="${application.title}"
        displayname="${application.title}"
        identifier="net.sourceforge.darwine.x86"
        icon="winehq.icns"
        shortversion="WineApp-1.0 | ${wine.version}"
        copyright="${wine.license}"
        applicationCategory="public.app-category.utility"
        outputdirectory="${dist.dir}"
        mainclassname="${main.class}">
        <classpath file="${dist.jar}" />
        <option value="-Dapple.laf.useScreenMenuBar=true"/>
    </bundleapp>
</target>
like image 168
jeremiah Avatar answered Dec 26 '22 13:12

jeremiah