Page 1 of 1

Compatibility

PostPosted: 28 Sep 2009, 21:11
by silly freak
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.

Re: Compatibility

PostPosted: 28 Sep 2009, 21:31
by Chris H.
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

Re: Compatibility

PostPosted: 29 Sep 2009, 08:13
by silly freak
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)

Re: Compatibility

PostPosted: 30 Sep 2009, 19:18
by mtgrares
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.

Re: Compatibility

PostPosted: 30 Sep 2009, 21:18
by silly freak
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.

Re: Compatibility

PostPosted: 30 Sep 2009, 21:53
by DennisBergkamp
Awesome, so this should be compatible with 1.5 versions of java?