problem with statement

Discussion in 'Java' started by Jeremy Watts, Jun 10, 2007.

  1. Jeremy Watts

    Jeremy Watts Guest

    Hi,

    I have the Java JDK installed on my old Sony Vaio laptop, but recently
    switched to use my newer computer. I re-installed the Java development kit
    (which used to be called the JDK ?? and now is called the SDK or
    something.... Anyway I use the BlueJ IDE alongside it too, so also
    downloaded that, so far so good.

    I take a Java program from my old machine to try on my new set-up and theres
    an error generated at a particular line, the error says :-

    " '(' or '[' expected "

    And the line in question is :-

    "List<Object>result = new ArrayList<Object>();"

    This works fine on my old set-up but not on the new!!??? Why?????????

    Please save my mental health...

    Jeremy Watts
     
    Jeremy Watts, Jun 10, 2007
    #1
    1. Advertising

  2. Jeremy Watts wrote on 10.06.2007 13:26:
    > Hi,
    >
    > I have the Java JDK installed on my old Sony Vaio laptop, but recently
    > switched to use my newer computer. I re-installed the Java development kit
    > (which used to be called the JDK ?? and now is called the SDK or
    > something.... Anyway I use the BlueJ IDE alongside it too, so also
    > downloaded that, so far so good.
    >
    > I take a Java program from my old machine to try on my new set-up and theres
    > an error generated at a particular line, the error says :-
    >
    > " '(' or '[' expected "
    >
    > And the line in question is :-
    >
    > "List<Object>result = new ArrayList<Object>();"
    >
    > This works fine on my old set-up but not on the new!!??? Why?????????


    Looks like on your old computer you had Java 1.5 installed and your new computer
    has Java 1.4. You have to remove the (outdated) JDK from your new computer and
    install a more recent version (Java6 aka 1.6 or Java5 aka 1.5)

    Thomas
     
    Thomas Kellerer, Jun 10, 2007
    #2
    1. Advertising

  3. Jeremy Watts

    Roedy Green Guest

    On Sun, 10 Jun 2007 11:26:18 GMT, "Jeremy Watts"
    <> wrote, quoted or indirectly quoted someone
    who said :

    >I have the Java JDK installed on my old Sony Vaio laptop, but recently
    >switched to use my newer computer. I re-installed the Java development kit
    >(which used to be called the JDK ?? and now is called the SDK or
    >something.... Anyway I use the BlueJ IDE alongside it too, so also
    >downloaded that, so far so good.
    >
    >I take a Java program from my old machine to try on my new set-up and theres
    >an error generated at a particular line, the error says :-
    >
    >" '(' or '[' expected "
    >
    >And the line in question is :-
    >
    >"List<Object>result = new ArrayList<Object>();"
    >
    >This works fine on my old set-up but not on the new!!??? Why?????????


    I suspect you have installed a very old Java that does not understand
    generics. See http://mindprod.com/jgloss/jdk.html
    to get the latest JDK (Java Development Kit)
    SDK is Microsoft's term.

    follow the instructions for install and test.

    Check out your installation with wassup
    see http://mindprod.com/applet/wassup.html
    --
    Roedy Green Canadian Mind Products
    The Java Glossary
    http://mindprod.com
     
    Roedy Green, Jun 15, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    3
    Views:
    833
  2. Jay McGavren
    Replies:
    11
    Views:
    1,182
    Alan Krueger
    Jan 16, 2006
  3. tedsuzman
    Replies:
    2
    Views:
    7,164
    Michel Claveau, résurectionné d'outre-bombe inform
    Jul 21, 2004
  4. Ted
    Replies:
    1
    Views:
    494
    Duncan Booth
    Jul 22, 2004
  5. Replies:
    21
    Views:
    1,087
    Giannis Papadopoulos
    Aug 2, 2005
Loading...

Share This Page