Re: Launching JavaFX apps

2014-02-12 Thread David DeHaven

Use of JavaFX-Class-Path is supported but highly discouraged as it leads to 
ClassLoader juggling, it was required when there was no SE launcher support for 
JavaFX. It is only supported for backward compatibility, new applications 
should NOT use it.

Either JavaFX-Application-Class or Main-Class can be used to specify the main 
entry point for the application. If both are present, then 
JavaFX-Application-Class will be used. Whichever is used, the presence of main 
is not required if it's a JavaFX application as the entire launch process is 
handed over to the JavaFX launcher impl. As with JavaFX-Class-Path, use of 
JavaFX-Application-Class is now discouraged but not quite as strongly.

The SE launcher ignores JavaFX-Version. I don't think it's used any more in 
JavaFX either, the only mention of it is "// If we ever need to check 
JavaFX-Version, do that here..." in LauncherImpl.java.


History:
JDK-8001533 allowed Main-Class to specify a JavaFX application as the main 
class, but it ignored JavaFX-Application-Class (among others)
JDK-8004547 fixed the above issue, the SE launcher now checks for J-A-C in the 
manifest and uses it as the Main-Class if present

-DrD-

On Feb 12, 2014, at 2:07 PM, Florian Brunner  wrote:

> Could someone elaborate on this?
> 
> Thanks!
> 
> -Florian
> 
> Am Samstag, 18. Januar 2014, 13.27:07 schrieb Florian Brunner:
>> Hi Kevin,
>> 
>> Thanks for this clarifiacation! I'm also interested in this kind of 
>> information as I'm in the process of upgrading Drombler FX to JavaFX 8 and 
>> Drombler FX comes with a custom Maven Plugin, which makes sure the 
>> application can start.
>> 
>> Another related question:
>> 
>> While the Ant task for JavaFX 2.x added the following Manifest entries:
>> 
>> JavaFX-Version: 2.2
>> JavaFX-Application-Class: myPackage.MyApplication
>> JavaFX-Class-Path: 
>> Main-Class: com/javafx/main/Main
>> 
>> 
>> the Ant task for JavaFX 8 added the following Manifest entries:
>> JavaFX-Version: 2.2
>> Class-Path: 
>> Main-Class: myPackage.MyApplication
>> 
>> So it seems "JavaFX-Application-Class" is not used anymore if one doesn't 
>> use com.javafx.main.Main to start the JavaFX application, and 
>> "JavaFX-Class-Path" has been replaced with the standard "Class-Path" entry.
>> 
>> The "JavaFX-Version" seems still to be needed, however. For what is it used? 
>> An why is this version set to "2.2" for JavaFX 8 applications? Shouldn't it 
>> be "8.0" or something?
>> Can I get this version from somewhere? Either the JavaFX API or from the 
>> ant-javafx.jar?
>> 
>> -Florian
>> 
>> Am Mittwoch, 8. Januar 2014, 06.45:36 schrieb Kevin Rushforth:
>>> Hi Scott,
>>> 
>>> The Java 8 launcher has been modified to recognize JavaFX applications 
>>> -- that is, classes that extend javafx.application.Application -- and 
>>> launch them directly by calling into the JavaFX launcher code. See 
>>> JDK-8001533 . This is 
>>> why the com.javafx.main.Main class is no longer needed.
>>> 
>>> Somewhat independent of this, for standalone applications (but not 
>>> applets or web start applications) the JavaFX launcher code will now 
>>> call the main() method if it is present (see RT-28755 
>>> ), but will still happily 
>>> launch the application if it isn't. So the main() method is still 
>>> optional. If present, it must call Application.launch() in order to 
>>> launch the application.
>>> 
>>> So yes, it does seem that Netbeans should modify the wording of their 
>>> javadoc comment for the main() method of a JavaFX application.
>>> 
>>> -- Kevin
>>> 
>>> 
>>> Scott Palmer wrote:
 Based on the discussion I saw in the comments for RT-34236 I discovered
 that using com.javafx.main.Main is not the way JavaFX 8 is supposed to
 work. There are comments that read, "...making sure their Application class
 has a main that calls launcher(String[] args)."
 
 This seems to imply that a main method is now required in the Application
 class when writing apps for JavaFX 8.
 
 Is this correct?
 
 If so. Somebody should tell NetBeans to stop injecting this comment in the
 generated application class for JavaFX projects:
 /**
 * The main() method is ignored in correctly deployed JavaFX application.
 * main() serves only as fallback in case the application can not be
 * launched through deployment artifacts, e.g., in IDEs with limited FX
 * support. NetBeans ignores main().
 *
 * @param args the command line arguments
 */
 
 Are the changes to the launching of JavaFX apps docuemtned somewhere?  Is
 using javafxpackager or the ant task the *only* supported way of creating
 JavaFX applications?  I'm currently using my own stub that runs on Java 7
 and adds the jfxrt.jar to the classpath if required and then calls the
 launch method on the Applicaiton class.
 
 Regards,
 
 Sco

Re: Launching JavaFX apps

2014-02-12 Thread Florian Brunner
Could someone elaborate on this?

Thanks!

-Florian

Am Samstag, 18. Januar 2014, 13.27:07 schrieb Florian Brunner:
> Hi Kevin,
> 
> Thanks for this clarifiacation! I'm also interested in this kind of 
> information as I'm in the process of upgrading Drombler FX to JavaFX 8 and 
> Drombler FX comes with a custom Maven Plugin, which makes sure the 
> application can start.
> 
> Another related question:
> 
> While the Ant task for JavaFX 2.x added the following Manifest entries:
> 
> JavaFX-Version: 2.2
> JavaFX-Application-Class: myPackage.MyApplication
> JavaFX-Class-Path: 
> Main-Class: com/javafx/main/Main
> 
> 
> the Ant task for JavaFX 8 added the following Manifest entries:
> JavaFX-Version: 2.2
> Class-Path: 
> Main-Class: myPackage.MyApplication
> 
> So it seems "JavaFX-Application-Class" is not used anymore if one doesn't use 
> com.javafx.main.Main to start the JavaFX application, and "JavaFX-Class-Path" 
> has been replaced with the standard "Class-Path" entry.
> 
> The "JavaFX-Version" seems still to be needed, however. For what is it used? 
> An why is this version set to "2.2" for JavaFX 8 applications? Shouldn't it 
> be "8.0" or something?
> Can I get this version from somewhere? Either the JavaFX API or from the 
> ant-javafx.jar?
> 
> -Florian
> 
> Am Mittwoch, 8. Januar 2014, 06.45:36 schrieb Kevin Rushforth:
> > Hi Scott,
> > 
> > The Java 8 launcher has been modified to recognize JavaFX applications 
> > -- that is, classes that extend javafx.application.Application -- and 
> > launch them directly by calling into the JavaFX launcher code. See 
> > JDK-8001533 . This is 
> > why the com.javafx.main.Main class is no longer needed.
> > 
> > Somewhat independent of this, for standalone applications (but not 
> > applets or web start applications) the JavaFX launcher code will now 
> > call the main() method if it is present (see RT-28755 
> > ), but will still happily 
> > launch the application if it isn't. So the main() method is still 
> > optional. If present, it must call Application.launch() in order to 
> > launch the application.
> > 
> > So yes, it does seem that Netbeans should modify the wording of their 
> > javadoc comment for the main() method of a JavaFX application.
> > 
> > -- Kevin
> > 
> > 
> > Scott Palmer wrote:
> > > Based on the discussion I saw in the comments for RT-34236 I discovered
> > > that using com.javafx.main.Main is not the way JavaFX 8 is supposed to
> > > work. There are comments that read, "...making sure their Application 
> > > class
> > > has a main that calls launcher(String[] args)."
> > >
> > > This seems to imply that a main method is now required in the Application
> > > class when writing apps for JavaFX 8.
> > >
> > > Is this correct?
> > >
> > > If so. Somebody should tell NetBeans to stop injecting this comment in the
> > > generated application class for JavaFX projects:
> > > /**
> > >  * The main() method is ignored in correctly deployed JavaFX application.
> > >  * main() serves only as fallback in case the application can not be
> > >  * launched through deployment artifacts, e.g., in IDEs with limited FX
> > >  * support. NetBeans ignores main().
> > >  *
> > >  * @param args the command line arguments
> > >  */
> > >
> > > Are the changes to the launching of JavaFX apps docuemtned somewhere?  Is
> > > using javafxpackager or the ant task the *only* supported way of creating
> > > JavaFX applications?  I'm currently using my own stub that runs on Java 7
> > > and adds the jfxrt.jar to the classpath if required and then calls the
> > > launch method on the Applicaiton class.
> > >
> > > Regards,
> > >
> > > Scott
> > >   
> 



Re: Launching JavaFX Apps with Java 8

2014-01-23 Thread Scott Palmer
Interesting.. but the example that I saw after following the link to
RT12169 call launch at least.  This issue happens without calling launch on
the application class.  That doesn't make much sense to me, since I
wouldn't even expect the Platform thread to be running at that point.

Scott


On Thu, Jan 23, 2014 at 8:53 PM, Alexander Kouznetsov <
alexander.kouznet...@oracle.com> wrote:

> I would expect the same.
>
> However, there are bugs already filed on this:
> https://javafx-jira.kenai.com/browse/RT-19863
>
> Best regards,
> Alexander Kouznetsov
> (408) 276-0387
>
>
> On 23 янв 2014 17:31, Scott Palmer wrote:
>
>> For me it prints the "Hi mom!" message and hangs.   Since there is no
>> showing Stage, I would expect it to exit.   Shall I file a bug?
>>
>
>


Re: Launching JavaFX Apps with Java 8

2014-01-23 Thread Alexander Kouznetsov

I would expect the same.

However, there are bugs already filed on this: 
https://javafx-jira.kenai.com/browse/RT-19863


Best regards,
Alexander Kouznetsov
(408) 276-0387

On 23 янв 2014 17:31, Scott Palmer wrote:

For me it prints the "Hi mom!" message and hangs.   Since there is no
showing Stage, I would expect it to exit.   Shall I file a bug?




Launching JavaFX Apps with Java 8

2014-01-23 Thread Scott Palmer
Since the Java 8 launcher now calls main(Strin []args]) if present, what is
the expected behaviour of this code?:

import javafx.application.Application;
import javafx.stage.Stage;

public class Main extends Application {

public static void main(String [] args) {
System.out.println("Hi mom!");
}

@Override
public void start(Stage stage) throws Exception {
throw new UnsupportedOperationException("Not supported yet.");
}
}



For me it prints the "Hi mom!" message and hangs.   Since there is no
showing Stage, I would expect it to exit.   Shall I file a bug?


Scott


Re: Launching JavaFX apps

2014-01-18 Thread Florian Brunner
Hi Kevin,

Thanks for this clarifiacation! I'm also interested in this kind of information 
as I'm in the process of upgrading Drombler FX to JavaFX 8 and Drombler FX 
comes with a custom Maven Plugin, which makes sure the application can start.

Another related question:

While the Ant task for JavaFX 2.x added the following Manifest entries:

JavaFX-Version: 2.2
JavaFX-Application-Class: myPackage.MyApplication
JavaFX-Class-Path: 
Main-Class: com/javafx/main/Main


the Ant task for JavaFX 8 added the following Manifest entries:
JavaFX-Version: 2.2
Class-Path: 
Main-Class: myPackage.MyApplication

So it seems "JavaFX-Application-Class" is not used anymore if one doesn't use 
com.javafx.main.Main to start the JavaFX application, and "JavaFX-Class-Path" 
has been replaced with the standard "Class-Path" entry.

The "JavaFX-Version" seems still to be needed, however. For what is it used? An 
why is this version set to "2.2" for JavaFX 8 applications? Shouldn't it be 
"8.0" or something?
Can I get this version from somewhere? Either the JavaFX API or from the 
ant-javafx.jar?

-Florian

Am Mittwoch, 8. Januar 2014, 06.45:36 schrieb Kevin Rushforth:
> Hi Scott,
> 
> The Java 8 launcher has been modified to recognize JavaFX applications 
> -- that is, classes that extend javafx.application.Application -- and 
> launch them directly by calling into the JavaFX launcher code. See 
> JDK-8001533 . This is 
> why the com.javafx.main.Main class is no longer needed.
> 
> Somewhat independent of this, for standalone applications (but not 
> applets or web start applications) the JavaFX launcher code will now 
> call the main() method if it is present (see RT-28755 
> ), but will still happily 
> launch the application if it isn't. So the main() method is still 
> optional. If present, it must call Application.launch() in order to 
> launch the application.
> 
> So yes, it does seem that Netbeans should modify the wording of their 
> javadoc comment for the main() method of a JavaFX application.
> 
> -- Kevin
> 
> 
> Scott Palmer wrote:
> > Based on the discussion I saw in the comments for RT-34236 I discovered
> > that using com.javafx.main.Main is not the way JavaFX 8 is supposed to
> > work. There are comments that read, "...making sure their Application class
> > has a main that calls launcher(String[] args)."
> >
> > This seems to imply that a main method is now required in the Application
> > class when writing apps for JavaFX 8.
> >
> > Is this correct?
> >
> > If so. Somebody should tell NetBeans to stop injecting this comment in the
> > generated application class for JavaFX projects:
> > /**
> >  * The main() method is ignored in correctly deployed JavaFX application.
> >  * main() serves only as fallback in case the application can not be
> >  * launched through deployment artifacts, e.g., in IDEs with limited FX
> >  * support. NetBeans ignores main().
> >  *
> >  * @param args the command line arguments
> >  */
> >
> > Are the changes to the launching of JavaFX apps docuemtned somewhere?  Is
> > using javafxpackager or the ant task the *only* supported way of creating
> > JavaFX applications?  I'm currently using my own stub that runs on Java 7
> > and adds the jfxrt.jar to the classpath if required and then calls the
> > launch method on the Applicaiton class.
> >
> > Regards,
> >
> > Scott
> >   



Re: Launching JavaFX apps

2014-01-15 Thread Scott Palmer
Yes that too.. Sorry.. there were many points in my email and I
misunderstood which you were referring to.  I will file the bug with NB
regarding the default comments in a JavaFX project.

My other comment was referring to the launcher.exe that JavaFX packager
uses and that is of course a JavaFX issue.  RT-35271 specifically.


Thanks,

Scott



On Wed, Jan 15, 2014 at 8:40 AM, Alexander Kouznetsov <
alexander.kouznet...@oracle.com> wrote:

>  Scott,
>
> I didn't get that. Are you saying that main() method javadoc is correct?
>
> Best regards,
> Alexander Kouznetsov(408) 276-0387
>
> On 15 янв 2014 16:40, Scott Palmer wrote:
>
> Thanks.  I'm participating in NetCat 8.0 so I'm well aware of that link
> :-).  But this doesn't appear to be a NetBeans issue.  Inclusion of
> metadata into the launcher stub is not implemented in the javafxpackager
> command line tool or ant task as far as I can tell. (I'm using the gradle
> plugin mainly at this point, but it just delegates to the ant task as far
> as I can tell.)
>
>  Cheers,
>
>  Scott
>
>
>
>
> On Wed, Jan 15, 2014 at 6:45 AM, Alexander Kouznetsov <
> alexander.kouznet...@oracle.com> wrote:
>
>> Here is the link to file a bug on NetBeans:
>> http://netbeans.org/bugzilla/enter_bug.cgi
>>
>> Best regards,
>> Alexander Kouznetsov
>> (408) 276-0387
>>
>>
>> On 8 янв 2014 18:45, Kevin Rushforth wrote:
>>
>>>
>>>
>>> So yes, it does seem that Netbeans should modify the wording of their
>>> javadoc comment for the main() method of a JavaFX application.
>>>
>>
>>
>
>


Re: Launching JavaFX apps

2014-01-15 Thread Kevin Rushforth
I'll check, but I would be surprised to find this comment insertion code 
in FX. I'm almost certain it is in the JavaFX project code in NetBeans.


-- Kevin


Scott Palmer wrote:
Thanks.  I'm participating in NetCat 8.0 so I'm well aware of that 
link :-).  But this doesn't appear to be a NetBeans issue.  Inclusion 
of metadata into the launcher stub is not implemented in the 
javafxpackager command line tool or ant task as far as I can tell. 
(I'm using the gradle plugin mainly at this point, but it just 
delegates to the ant task as far as I can tell.)


Cheers,

Scott




On Wed, Jan 15, 2014 at 6:45 AM, Alexander Kouznetsov 
> wrote:


Here is the link to file a bug on NetBeans:
http://netbeans.org/bugzilla/enter_bug.cgi

Best regards,
Alexander Kouznetsov
(408) 276-0387 


On 8 янв 2014 18:45, Kevin Rushforth wrote:



So yes, it does seem that Netbeans should modify the wording
of their javadoc comment for the main() method of a JavaFX
application.





Re: Launching JavaFX apps

2014-01-15 Thread Alexander Kouznetsov

Scott,

I didn't get that. Are you saying that main() method javadoc is correct?

Best regards,
Alexander Kouznetsov
(408) 276-0387

On 15 янв 2014 16:40, Scott Palmer wrote:
Thanks.  I'm participating in NetCat 8.0 so I'm well aware of that 
link :-).  But this doesn't appear to be a NetBeans issue.  Inclusion 
of metadata into the launcher stub is not implemented in the 
javafxpackager command line tool or ant task as far as I can tell. 
(I'm using the gradle plugin mainly at this point, but it just 
delegates to the ant task as far as I can tell.)


Cheers,

Scott




On Wed, Jan 15, 2014 at 6:45 AM, Alexander Kouznetsov 
> wrote:


Here is the link to file a bug on NetBeans:
http://netbeans.org/bugzilla/enter_bug.cgi

Best regards,
Alexander Kouznetsov
(408) 276-0387 


On 8 янв 2014 18:45, Kevin Rushforth wrote:



So yes, it does seem that Netbeans should modify the wording
of their javadoc comment for the main() method of a JavaFX
application.







Re: Launching JavaFX apps

2014-01-15 Thread Scott Palmer
Thanks.  I'm participating in NetCat 8.0 so I'm well aware of that link
:-).  But this doesn't appear to be a NetBeans issue.  Inclusion of
metadata into the launcher stub is not implemented in the javafxpackager
command line tool or ant task as far as I can tell. (I'm using the gradle
plugin mainly at this point, but it just delegates to the ant task as far
as I can tell.)

Cheers,

Scott




On Wed, Jan 15, 2014 at 6:45 AM, Alexander Kouznetsov <
alexander.kouznet...@oracle.com> wrote:

> Here is the link to file a bug on NetBeans: http://netbeans.org/bugzilla/
> enter_bug.cgi
>
> Best regards,
> Alexander Kouznetsov
> (408) 276-0387
>
>
> On 8 янв 2014 18:45, Kevin Rushforth wrote:
>
>>
>>
>> So yes, it does seem that Netbeans should modify the wording of their
>> javadoc comment for the main() method of a JavaFX application.
>>
>
>


Re: Launching JavaFX apps

2014-01-15 Thread Alexander Kouznetsov
Here is the link to file a bug on NetBeans: 
http://netbeans.org/bugzilla/enter_bug.cgi


Best regards,
Alexander Kouznetsov
(408) 276-0387

On 8 янв 2014 18:45, Kevin Rushforth wrote:



So yes, it does seem that Netbeans should modify the wording of their 
javadoc comment for the main() method of a JavaFX application. 




Re: Launching JavaFX apps

2014-01-08 Thread Kevin Rushforth

Hi Scott,

The Java 8 launcher has been modified to recognize JavaFX applications 
-- that is, classes that extend javafx.application.Application -- and 
launch them directly by calling into the JavaFX launcher code. See 
JDK-8001533 . This is 
why the com.javafx.main.Main class is no longer needed.


Somewhat independent of this, for standalone applications (but not 
applets or web start applications) the JavaFX launcher code will now 
call the main() method if it is present (see RT-28755 
), but will still happily 
launch the application if it isn't. So the main() method is still 
optional. If present, it must call Application.launch() in order to 
launch the application.


So yes, it does seem that Netbeans should modify the wording of their 
javadoc comment for the main() method of a JavaFX application.


-- Kevin


Scott Palmer wrote:

Based on the discussion I saw in the comments for RT-34236 I discovered
that using com.javafx.main.Main is not the way JavaFX 8 is supposed to
work. There are comments that read, "...making sure their Application class
has a main that calls launcher(String[] args)."

This seems to imply that a main method is now required in the Application
class when writing apps for JavaFX 8.

Is this correct?

If so. Somebody should tell NetBeans to stop injecting this comment in the
generated application class for JavaFX projects:
/**
 * The main() method is ignored in correctly deployed JavaFX application.
 * main() serves only as fallback in case the application can not be
 * launched through deployment artifacts, e.g., in IDEs with limited FX
 * support. NetBeans ignores main().
 *
 * @param args the command line arguments
 */

Are the changes to the launching of JavaFX apps docuemtned somewhere?  Is
using javafxpackager or the ant task the *only* supported way of creating
JavaFX applications?  I'm currently using my own stub that runs on Java 7
and adds the jfxrt.jar to the classpath if required and then calls the
launch method on the Applicaiton class.

Regards,

Scott
  


Launching JavaFX apps

2014-01-08 Thread Scott Palmer
Based on the discussion I saw in the comments for RT-34236 I discovered
that using com.javafx.main.Main is not the way JavaFX 8 is supposed to
work. There are comments that read, "...making sure their Application class
has a main that calls launcher(String[] args)."

This seems to imply that a main method is now required in the Application
class when writing apps for JavaFX 8.

Is this correct?

If so. Somebody should tell NetBeans to stop injecting this comment in the
generated application class for JavaFX projects:
/**
 * The main() method is ignored in correctly deployed JavaFX application.
 * main() serves only as fallback in case the application can not be
 * launched through deployment artifacts, e.g., in IDEs with limited FX
 * support. NetBeans ignores main().
 *
 * @param args the command line arguments
 */

Are the changes to the launching of JavaFX apps docuemtned somewhere?  Is
using javafxpackager or the ant task the *only* supported way of creating
JavaFX applications?  I'm currently using my own stub that runs on Java 7
and adds the jfxrt.jar to the classpath if required and then calls the
launch method on the Applicaiton class.

Regards,

Scott