Compile specific Apple API (com.apple.eawt) on Windows

2013-10-27 Thread Abu Abdullah
Hi,

Windows port of Oracle JDK 7 does not include com.apple.eawt.* classes
preventing compiling the code on Windows. Is there any way to overcome
this. My main development platform is Windows and rarely I'm able to test
the code on Mac machine.


JavaAppLauncher and working directory

2014-04-06 Thread Abu Abdullah
Hi,

I'm trying to bundle my application using Oracle JavaAppLauncher (from the
AppBundler project files). all app classes are not in Jar but in a simple
directory structure as follow:

my.app/Contents/Java/
my.app/Contents/Java/classes
my.app/Contents/Java/setting
my.app/Contents/Java/lib
my.app/Contents/Java/bin
my.app/Contents/Java/db
my.app/Contents/Java/Launcher.jar   (This is just launcher jar and
does not have any classes)
my.app/Contents/MacOS/JavaAppLauncher
my.app/Contents/PkgInfo
my.app/Contents/PlugIns/jdk1.8.0.jdk
my.app/Contents/Resources/icon.icns

I'm using scripting to do this and not by AppBundler.
Once i launch the application, it didn't recognize its location and hence
other folders are not seen. NullPointerException are thrown because of this.

I tried many things without successful e.g. -Duser.dir in the info.plist,
copying the files to many places in root, in MacOS folder, in Resources
folder, in Resources/Java folder. I'm not able to launch it. I'm
troubleshooting by running ./JavaAppLauncher

appreciate any help


Re: JavaAppLauncher and working directory

2014-04-07 Thread Abu Abdullah
On Sun, Apr 6, 2014 at 6:45 PM, Joe McGlynn joe.mcgl...@oracle.com wrote:

 I don't believe the app bundler project is maintained any longer.  That
 code was subsumed into the FX Packager (which works for non-FX apps)
 about a year ago.  FWIW, I suspect that you need to put your application
 classes into a JAR file for it to work properly, but that is just a 
 guess.http://www.oracle.com/commitment

 I'd recommend starting with the packager tool that is in the EA release of
 8u20, it has been significantly updated for this release and if you
 discover a problem or feature gap that is where we'll be working to address
 it.


 I used javafxpackager and the result is the same. I'm still getting such
errors:
java.io.FileNotFoundException: setting/font.properties ..

i have added he folders manually to the resulted DMG.

is there anything that can be done. should the app be really jar file only.
How can I create DMG with a project containing many folders db, index.


Re: JavaAppLauncher and working directory

2014-04-10 Thread Abu Abdullah


 I believe the way this works is that any jars in the Java directory are
 added to classpath _but_ the Java directory itself is not classpath. The
 Classes directory it contains is in classpath.

 For example:

 set java.class.path
 java.class.path=/Users/mjh/HalfPipe/HalfPipe7.app/Contents/Java/Classes:/Users/mjh/HalfPipe/HalfPipe7.app/Contents/Java/antlr-2.7.7.jar:...[Other
 jars in the Java directory automatically
 added].../Users/mjh/HalfPipe/HalfPipe7.app/Contents/Java/weka.jar

 Notice Java directory itself not there. Java/Classes is there.
  So that you can access resources off of that with something like...

   try {
ClassLoader cl = new java.net.URLClassLoader(new java.net.URL[0]);
BufferedReader rdr
 = new BufferedReader(new 
 InputStreamReader(cl.getResourceAsStream(Scripts/loader.js)));
jsEngine.eval(rdr);
}
catch (Exception ex) {
 ex.printStackTrace(org.cmdline.common.Configuration.getSysOut()); }

 Where Scripts/loader.js is located in the above mentioned Classes
 directory.
 user.dir I would still suggest is not a reliable way to access application
 files going forward.


Thanks for the tip, it is working if i do so. I was hoping not to change
the code since it was just working fine with JavaApplicationStub.


Re: Javafxpackager and splash screen

2014-04-11 Thread Abu Abdullah
On Sat, Apr 12, 2014 at 6:19 AM, Michael Hall mik3h...@gmail.com wrote:


 i tried even the absolute path in case APP_ROOT is not supported but not
 working.


 I seem to remember support for something like this being added. But am not
 sure. You could check the source.


I tried also with jdk1.8.0 u20 as well but it is the same version
javafxpackager 2.2




 For some reason, I'm not able to do it even using the infinitekind
 appbundler, maybe it is not supporting jdk 1.8

 Any help is appreciated.


 It is probably not a problem in passing the JVMOption, I would guess about
 anything you say is a JVMOption is probably passed as is without much, if
 any, editing.
 If this is true then appbundler or infinitekind shouldn't matter. The
 problem would probably be the OS X port support of the splash option.
 Does it run command line? java -splash:path/to/image ...
 I think you would need the 1.8 JDK installed to check this.


yes it runs through command line and I'm trying with both 1.8.0 and u20