[RT-33954] static block...causes IllegalStateException - re-open?

Stephen F Northover steve.x.northover at oracle.com
Tue Apr 8 13:30:29 UTC 2014

Right, I jumped in mid-thread.  The link points to an IntelliJ issue 
that talks about launching only.

IntelliJ inserts its own launcher and this isn't great, but do we have 
concrete problems or JIRA that are caused by this?


On 2014-04-08 9:21 AM, Kevin Rushforth wrote:
> Note that this feature request is only somewhat related to the issue 
> at hand. Yes we would like IntelliJ (and Eclipse) to recognize and 
> launch JavaFX application subclasses with no main method, but the 
> issue here is that IntelliJ (unlike the other IDEs) inserts its own 
> launcher class in front of the program you are running, which causes 
> the Java launcher to not recognize that it is being asked to launch a 
> JavaFX program. So we could either file a new JIRA or maybe add the 
> additional information to the existing one that Richard filed.
> Either way, we need to document this on our Wiki to warn IntelliJ 
> users of this.
> -- Kevin
> Stephen F Northover wrote:
>> The two ways of launching are equivalent however, at one point, we 
>> did not run main() even when main() was available and this caused 
>> problems on the desktop.  Lots of code was written that expected 
>> main() to run and this code was broken.  We will be supporting both 
>> ways of launching an FX application for the foreseeable future, 
>> however, the IDE's still need to understand that FX applications that 
>> only contain start() are launchable.
>> Steve
>> On 2014-04-08 8:34 AM, ngalarneau at ABINITIO.COM wrote:
>>> Hi Richard,
>>> You raised this IntelliJ issue here:
>>> http://youtrack.jetbrains.com/issue/IDEA-101939
>>> It is marked as a feature request.
>>> Are you guys saying that the 2 ways of launching are not equivalent?
>>> What is the difference?
>>> Maybe that issue should be upgraded to a BUG if the old launching 
>>> method
>>> is now wrong, not merely old fashioned.
>>> Neil
>>> From:   Richard Bair <richard.bair at oracle.com>
>>> To:     Kevin Rushforth <kevin.rushforth at oracle.com>
>>> Cc:     openjfx-dev at openjdk.java.net, Sandipan Razzaque 
>>> <me at sandipan.net>
>>> Date:   04/07/2014 09:43 PM
>>> Subject:        Re: [RT-33954] static block...causes 
>>> IllegalStateException
>>> - re-open?
>>> Sent by:        "openjfx-dev" <openjfx-dev-bounces at openjdk.java.net>
>>> Yes, this is one of the few things that I just hate about IDEA.
>>> On Apr 7, 2014, at 6:00 PM, Kevin Rushforth 
>>> <kevin.rushforth at oracle.com>
>>> wrote:
>>>> I can't speak to other IntelliJ issues, but the root cause of this
>>> particular one is the same thing that Debbie ran into last week --
>>> IntelliJ doesn't launch programs using the standard Java launcher. For
>>> whatever reason, it uses its own launcher. This might be worth raising
>>> with JetBrains.
>>>> -- Kevin
>>>> Jonathan Giles wrote:
>>>>> Kevin,
>>>>> Yes, that is the program I used, and yes, I get the 'Toolkit not
>>> initialized' exception. I am running IntelliJ, so that is the reason. I
>>> switched over to Eclipse and the code run as expected.
>>>>> I am slightly bothered by the occasional failures that seem to be
>>> IntelliJ-specific. I have a gut feeling that it doesn't always run all
>>> tests (or that it runs them slightly differently to get different 
>>> results
>>> than when run on the command line). Does anyone know why this is?
>>>>> I'm actually most at home in Eclipse, so perhaps I should switch to
>>> that as my primary IDE for OpenJFX development.
>>>>> -- Jonathan
>>>>> On 8/04/2014 11:29 a.m., Kevin Rushforth wrote:
>>>>>> Just to make sure we are running the same program, the one I ran to
>>> verify that RT-33954 is fixed was the simple test program in the 
>>> comments
>>> of that bug. Here it is (with the imports omitted for brevity).
>>>>>> public class Example extends Application {
>>>>>>    public static void main(String[] args) {
>>>>>>        //this is called from a static block in
>>> javafx.scene.control.Control
>>>>>> PlatformImpl.setDefaultPlatformUserAgentStylesheet();
>>>>>>        Application.launch(args);
>>>>>>    }
>>>>>>    @Override
>>>>>>    public void start(final Stage primaryStage) throws Exception {
>>>>>>    }
>>>>>> }
>>>>>> The above program runs fine for me with no exception.
>>>>>> Jonathan: are you seeing something different? Or perhaps running a
>>> different example?
>>>>>> NOTE: if you run this from IntelliJ it will not work. I verified 
>>>>>> that
>>> with Debbie last week (on a different issue), which may be why you are
>>> seeing a problem. Running it from command line, from NB, or from 
>>> Eclipse
>>> works.
>>>>>> -- Kevin
>>>>>> Jonathan Giles wrote:
>>>>>>> Firstly, I agree - this does seem to still be reproducible despite
>>> Kevin's comment that it should have been resolved in JavaFX 8.0 due to
>>> RT-28754 <https://javafx-jira.kenai.com/browse/RT-28754>, so that is
>>> troubling. I'll leave Kevin to comment on that.
>>>>>>> Secondly, RT-33954 was closed as a duplicate of RT-28754 <
>>> https://javafx-jira.kenai.com/browse/RT-28754>, so it would be 
>>> better to
>>> leave RT-33954 closed and move discussion (including what you recently
>>> posted) into RT-28754 
>>> <https://javafx-jira.kenai.com/browse/RT-28754>. The
>>> discussion can start in there and most probably a new bug will need 
>>> to be
>>> opened (as RT-28754 <https://javafx-jira.kenai.com/browse/RT-28754> did
>>> result in a code change that at one point appears to have fixed the
>>> problem, so we're possibly dealing with a regression).
>>>>>>> Thirdly, whether this is a suitable bug for someone learning the
>>> ropes is debatable. I'll leave Kevin to offer his thoughts, but perhaps
>>> you can propose a patch that resolves this issue for you in your test
>>> scenarios. Also, a good starting point is to develop a simple test
>>> application that helps to demonstrate this issue (preferably the 
>>> test case
>>> is a single class with no dependencies), and which you can then 
>>> share in
>>> the jira issue via copy/paste into a comment.
>>>>>>> Fourthly, to be a contributor in the OpenJDK requires you to 
>>>>>>> follow a
>>> process to get the paperwork in order. It is wise to get that 
>>> started as
>>> soon as possible, as it can sometimes take a while. Here's a link to 
>>> the
>>> process: http://openjdk.java.net/contribute/ The main thing is the OCA.
>>>>>>> Finally, welcome! :-)
>>>>>>> -- Jonathan
>>>>>>> On 6/04/2014 1:06 p.m., Sandipan Razzaque wrote:
>>>>>>>> Hi JavaFX devs!
>>>>>>>> I was wondering how people felt about re-opening this bug? I don't
>>> believe
>>>>>>>> it has been fixed (see my comment).
>>>>>>>> I'm also happy to work on it. But, let me know if you think my 
>>>>>>>> time
>>> would
>>>>>>>> be better spent elsewhere. I'm keen to take on a small bug to just
>>> get the
>>>>>>>> hang of the process and community (I'll be stumbling with 
>>>>>>>> mercurial
>>> along
>>>>>>>> the way too!). I think this bug is an ideal candidate for someone
>>> just
>>>>>>>> learning the ropes.
>>>>>>>> https://javafx-jira.kenai.com/browse/RT-33954
>>>>>>>> Cheers,
>>>>>>>> SR
>>>>>>>> Sandipan Razzaque | www.sandipan.net
>>>   NOTICE from Ab Initio: This email (including any attachments) may 
>>> contain
>>> information that is subject to confidentiality obligations or is 
>>> legally
>>> privileged, and sender does not waive confidentiality or privilege. If
>>> received in error, please notify the sender, delete this email, and 
>>> make
>>> no further use, disclosure, or distribution.

More information about the openjfx-dev mailing list