It is currently 29 Oct 2025, 11:07
   
Text Size

java fx and transition to java 7

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Agetian, friarsol, Blacksmith, KrazyTheFox, CCGHQ Admins

java fx and transition to java 7

Postby Max mtg » 25 Apr 2013, 23:51

It's a known problem that swing leaks memory dealing with images, behaves in an unpredictable way when accessed from other threads than EDT and is becoming an outdated technology in general.

I suggest that we should use a newer UI framework for batlefield that is expected to consume less memory and be able to use modern videoboards where avaliable. That is Java FX 2.2 from Oracle.
It is also said to fire exceptions whenever programmer tries to use ui components from a wrong thread.
It allows to embed javafx scenes onto swing components, so it can be applied to a few areas to start with.

I haven't seen it before, but want to give it a try as soon as I return from a vacation (this Sunday through May 6). Thus in case of success we'll need to upscale the required jre version to 7 to support the new components.

What do you think of this?
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

Re: java fx and transition to java 7

Postby Chris H. » 03 May 2013, 12:00

Max mtg wrote:I haven't seen it before, but want to give it a try as soon as I return from a vacation (this Sunday through May 6). Thus in case of success we'll need to upscale the required jre version to 7 to support the new components.

What do you think of this?
 
I updated to java 7 a few weeks ago so this won't be a problem for me.

There may be some people in our user base that may have an issue in that they might be stuck at java 6 for some reason.
User avatar
Chris H.
Forge Moderator
 
Posts: 6320
Joined: 04 Nov 2008, 12:11
Location: Mac OS X Yosemite
Has thanked: 644 times
Been thanked: 643 times

Re: java fx and transition to java 7

Postby friarsol » 03 May 2013, 12:19

It probably would be fine to ugprade Forge to Java 7 requirements. But we should probably give two release notices that it's coming.

Announce now that sometime soon in the future Java 7 will be required to improve performance. Announce when the last release that support Java 6 is out, etc.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: java fx and transition to java 7

Postby Sloth » 17 May 2013, 22:32

Eclipse is complaining that the following expression is Java 7 only:

Code: Select all
List<String> unused = new ArrayList<>(4);
I can't compile without changing my project compliance and JRE to Java 7.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: java fx and transition to java 7

Postby Max mtg » 18 May 2013, 05:30

Sloth wrote:Eclipse is complaining that the following expression is Java 7 only:

Code: Select all
List<String> unused = new ArrayList<>(4);
I can't compile without changing my project compliance and JRE to Java 7.
I am sorry.
My environment is switched to use compiler from jdk 7 but still targets jre 6. Eclipse didin't mark this as an error.
If there is an obvious error, feel free to correct it and commit.

I have updated the file in r21510.
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

Re: java fx and transition to java 7

Postby Chris H. » 18 May 2013, 11:21

I had noticed a similar problem on my system. Thank you Max for fixing this. :)

Turns out that I still have the Java 6 JDK installed on my iMac. My new insulin pump requires a functioning java web plugin and Apple had disabled this in their Java 6 JDK.

I had followed instructions for installing the Oracle based java 7 JRE but this apparently gave me a mixture of a Java 6 JDK with the java 7 java web plugin. It works for my insulin pump but it looks like I need to eventually update to the Java 7 JDK.

At some point it looks like we will also have to change the project compliance over to java 7.
User avatar
Chris H.
Forge Moderator
 
Posts: 6320
Joined: 04 Nov 2008, 12:11
Location: Mac OS X Yosemite
Has thanked: 644 times
Been thanked: 643 times

Re: java fx and transition to java 7

Postby mark » 18 May 2013, 15:36

I use Java 7 (7 and only 7, no 6) since two years and never had major problems with forge. I also use the svn sources of forge and update daily; the only problem so far is low (but bearable) battlefield performance, especially while arrows are on the screen.
A friend of mine tried the newer versions and even if nothing is on the board, the performance there is devastating (changing phases needs nearly a second each). If you want to change because of Java FX, I think that will be fine for us :D
mark
 
Posts: 138
Joined: 28 Dec 2011, 11:32
Has thanked: 6 times
Been thanked: 11 times

Re: java fx and transition to java 7

Postby Agetian » 29 May 2013, 07:25

This is a welcome transition and sounds like a good plan overall. I have no objections whatsoever and I'm all for it. Also, I've updated to Java 7 a long time ago and can confirm that Forge is working very well with Java 7 on both Windows and Linux.

- Agetian
Agetian
Programmer
 
Posts: 3490
Joined: 14 Mar 2011, 05:58
Has thanked: 684 times
Been thanked: 572 times


Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 8 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 8 users online :: 0 registered, 0 hidden and 8 guests (based on users active over the past 10 minutes)
Most users ever online was 9298 on 10 Oct 2025, 12:54

Users browsing this forum: No registered users and 8 guests

Login Form