It is currently 30 Oct 2025, 03:46
   
Text Size

Compatibility

Post MTG Forge Related Programming Questions Here

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

Compatibility

Postby silly freak » 28 Sep 2009, 21:11

many users seem to have problems with forge because of features added from Java 1.6.
you can configure your eclipse to use a 1.5 compatible execution environment by going to the project properties (context menu, at the bottom). all in all, that means that the compiler will complain a bit more.
This unfortunately doesn't prevent you from newer libraries. the really clean way would be to use the real 1.5 JDK, but Sun requires you to enter information to download it, because it's at the end of the lifecycle. so the easiest we can do is just watch out in the javadocs for @since 1.6 and not use it.
___

where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
silly freak
DEVELOPER
 
Posts: 598
Joined: 26 Mar 2009, 07:18
Location: Vienna, Austria
Has thanked: 93 times
Been thanked: 25 times

Re: Compatibility

Postby Chris H. » 28 Sep 2009, 21:31

silly freak wrote:many users seem to have problems with forge because of features added from Java 1.6.
you can configure your eclipse to use a 1.5 compatible execution environment by going to the project properties (context menu, at the bottom). all in all, that means that the compiler will complain a bit more.
This unfortunately doesn't prevent you from newer libraries. the really clean way would be to use the real 1.5 JDK, but Sun requires you to enter information to download it, because it's at the end of the lifecycle. so the easiest we can do is just watch out in the javadocs for @since 1.6 and not use it.
On my Mac with the new Snow Leopard OS my system Java Preferences only list Java 1.6. I have configured Eclipse to build with the 1.5 compatible execution environment but it will still run under Java 1.6 on my computer.

As far as the downloading pictures code is concerned, I wonder if we colud somehow include both the old and the newer code and give the user a choice on which to use?

Can a Java application check to see which Java versions are installed and then make the choice for us? :-k
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: Compatibility

Postby silly freak » 29 Sep 2009, 08:13

The downloader is not a problem; I used a single-argument method that was new, the two argument version existed earlier. I'll post the code when I have time here

for choosing the JRE, I don't think that. The most recent one is better for us, so that shouldn't be a problem. choosing one is not possible from within Java. A command line script would do the script (but is platform dependent)
___

where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
silly freak
DEVELOPER
 
Posts: 598
Joined: 26 Mar 2009, 07:18
Location: Vienna, Austria
Has thanked: 93 times
Been thanked: 25 times

Re: Compatibility

Postby mtgrares » 30 Sep 2009, 19:18

As far as the downloading pictures code is concerned, I wonder if we colud somehow include both the old and the newer code and give the user a choice on which to use?
Well the problem with the downloading card picture code is that when a url in card-pictures.txt can't be read the url isn't skipped, which it should be, and the user is given the message that they need to be connected to the Internet. I wrote this code and I should be able to skip dead urls.

It does seem that some people don't have Java 1.6. Using Java is always a little problematic since it presumes that the user has something extra installed on their computer, which I'm talking about the Java runtime libraries. Gone are the days of a plain old, regular exe file.
mtgrares
DEVELOPER
 
Posts: 1352
Joined: 08 Sep 2008, 22:10
Has thanked: 3 times
Been thanked: 12 times

Re: Compatibility

Postby silly freak » 30 Sep 2009, 21:18

exe files are the same, except that the "extra thing" you have to have is windows, which provides all the libs or an exe. not having java is like not running windows for that matter. solving the first problem is easier than the second though ;)

btw, here's the small change to Gui_DownloadPictures
Code: Select all
public JDialog getDlg(JFrame frame) {
    final JDialog dlg = this.dlg.createDialog(frame, ForgeProps.getLocalized(TITLE));
    close.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            dlg.setVisible(false);
        }
    });
    return dlg;
}

public static void startDownload(JFrame frame) {
    final Card[] card = getNeededCards();
   
    if(card.length == 0) {
        JOptionPane.showMessageDialog(frame, ForgeProps.getLocalized(NO_MORE));
        return;
    }
   
    Gui_DownloadPictures download = new Gui_DownloadPictures(card);
    JDialog dlg = download.getDlg(frame);
    dlg.setVisible(true);
    dlg.dispose();
    download.setCancel(true);
}//startDownload()
the change is simply the additional parameter for createDialog. that version of the method exists longer that the one-arg one.
___

where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
silly freak
DEVELOPER
 
Posts: 598
Joined: 26 Mar 2009, 07:18
Location: Vienna, Austria
Has thanked: 93 times
Been thanked: 25 times

Re: Compatibility

Postby DennisBergkamp » 30 Sep 2009, 21:53

Awesome, so this should be compatible with 1.5 versions of java?
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time


Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 9 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 9 users online :: 0 registered, 0 hidden and 9 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 9 guests

Login Form