File tree Expand file tree Collapse file tree 4 files changed +22
-5
lines changed
src/com/oracle/appbundler Expand file tree Collapse file tree 4 files changed +22
-5
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,13 @@ <h3>Parameters</h3>
9393 file.</ td >
9494 < td align ="center " valign ="top "> No</ td >
9595 </ tr >
96+ < tr >
97+ < td valign ="top "> applicationCategory</ td >
98+ < td valign ="top "> The application category.
99+ Corresponds to the < code > LSApplicationCategoryType</ code > key in the < tt > Info.plist</ tt >
100+ file.</ td >
101+ < td align ="center " valign ="top "> No</ td >
102+ </ tr >
96103 < tr >
97104 < td valign ="top "> mainclassname</ td >
98105 < td valign ="top "> The name of the bundled application's main class.</ td >
Original file line number Diff line number Diff line change @@ -72,11 +72,8 @@ int launch(char *commandName) {
7272 // Get the main bundle
7373 NSBundle *mainBundle = [NSBundle mainBundle ];
7474
75- // Set the working directory to the main bundle root
76- NSString *mainBundlePath = [mainBundle bundlePath ];
77- if (chdir ([mainBundlePath UTF8String ]) == -1 ) {
78- [NSException raise: @JAVA_LAUNCH_ERROR format: @" Could not set initial working directory." ];
79- }
75+ // Set the working directory to the user's home directory
76+ chdir ([NSHomeDirectory () UTF8String ]);
8077
8178 // Get the main bundle's info dictionary
8279 NSDictionary *infoDictionary = [mainBundle infoDictionary ];
@@ -114,6 +111,7 @@ int launch(char *commandName) {
114111 }
115112
116113 // Set the class path
114+ NSString *mainBundlePath = [mainBundle bundlePath ];
117115 NSString *javaPath = [mainBundlePath stringByAppendingString: @" /Contents/Java" ];
118116 NSMutableString *classPath = [NSMutableString stringWithFormat: @" -Djava.class.path=%@ /Classes" , javaPath];
119117
Original file line number Diff line number Diff line change @@ -65,6 +65,8 @@ public class AppBundlerTask extends Task {
6565 private String signature = "????" ;
6666 private String copyright = "" ;
6767
68+ private String applicationCategory = null ;
69+
6870 // JVM info properties
6971 private String mainClassName = null ;
7072 private FileSet runtime = null ;
@@ -117,6 +119,10 @@ public void setCopyright(String copyright) {
117119 this .copyright = copyright ;
118120 }
119121
122+ public void setApplicationCategory (String applicationCategory ) {
123+ this .applicationCategory = applicationCategory ;
124+ }
125+
120126 public void setMainClassName (String mainClassName ) {
121127 this .mainClassName = mainClassName ;
122128 }
@@ -390,6 +396,10 @@ private void writeInfoPlist(File file) throws IOException {
390396 writeProperty (xout , "CFBundleVersion" , "1" );
391397 writeProperty (xout , "NSHumanReadableCopyright" , copyright );
392398
399+ if (applicationCategory != null ) {
400+ writeProperty (xout , "LSApplicationCategoryType" , applicationCategory );
401+ }
402+
393403 // Write runtime
394404 if (runtime != null ) {
395405 writeProperty (xout , "JVMRuntime" , runtime .getDir ().getParentFile ().getParentFile ().getName ());
Original file line number Diff line number Diff line change @@ -115,6 +115,7 @@ questions.
115115 displayname =" SwingSet 2"
116116 identifier =" com.oracle.javax.swing.SwingSet2"
117117 shortversion =" 1.0"
118+ applicationCategory =" public.app-category.developer-tools"
118119 mainclassname =" SwingSet2" >
119120 <runtime dir =" ${ env.JAVA_HOME } " >
120121 <exclude name =" db/" />
@@ -135,6 +136,7 @@ questions.
135136 displayname =" SwingSet 2 (Plugin)"
136137 identifier =" com.oracle.javax.swing.SwingSet2Plugin"
137138 shortversion =" 1.0"
139+ applicationCategory =" public.app-category.developer-tools"
138140 mainclassname =" SwingSet2" >
139141 <classpath file =" /Library/Java/Demos/JFC/SwingSet2/SwingSet2.jar" />
140142 <option value =" -Dapple.laf.useScreenMenuBar=true" />
You can’t perform that action at this time.
0 commit comments