This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Java in General and the fly likes I'm getting a few errors... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "I Watch "I New topic
Author

I'm getting a few errors...

Darryl Neeley
Greenhorn

Joined: Mar 18, 2006
Posts: 6
And I'm just wondering what they mean that I need to do. Mainly just Two. I'll post the section of code that it's doing it on too. Thank you for the help. =P

<identifier> expected
ArrayList<JCheckBox> checkboxList;
---------^

AND

"(" or "[" expected
checkboxList = newArrayList<JCheckBox>();
---------------------------^
[ March 18, 2006: Message edited by: Darryl Neeley ]
Keith Lynn
Ranch Hand

Joined: Feb 07, 2005
Posts: 2367
I believe that you are trying to compile code written for JDK 1.5 with JDK 1.4. Generics were added in 1.5, and if you compile in 1.4 you will get those errors.
Darryl Neeley
Greenhorn

Joined: Mar 18, 2006
Posts: 6
Dammit...that means I need to install 1.5/5.0, doesn't it? =(
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

Yep; or don't use generics. But installing a new JDK is really not a difficult thing. The only thing to watch out for is that your current JDK may have installed a copy of java.exe someplace like C:\WINDOWS; the symptom would be that after installing and updating your path, you'd see an error about "Unsupported class file version 49." If you have this problem, find the extra java.exe and delete it.


[Jess in Action][AskingGoodQuestions]
 
Consider Paul's rocket mass heater.
 
subject: I'm getting a few errors...