This week's book giveaways are in the iOS and Features new in Java 8 forums.
We're giving away four copies each of Barcodes with iOS: Bringing together the digital and physical worlds and Core Java for the Impatient and have the authors on-line!
See this thread and this one for details.
The moose likes Java in General and the fly likes Errors with ArrayList? I'm drowning in confusion! *glug* *glug* Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Barcodes with iOS this week in the iOS forum
or Core Java for the Impatient in the Java 8 forum!

JavaRanch » Java Forums » Java » Java in General
Bookmark "Errors with ArrayList? I Watch "Errors with ArrayList? I New topic

Errors with ArrayList? I'm drowning in confusion! *glug* *glug*

Adam Altmann

Joined: Jun 08, 2005
Posts: 21

For the past week or so, I've been writing a program to transfer records from one database to another. I've been writing it with Eclipse, and can run it, and it works, and everything is just dandy.

HOWEVER, if I try to compile at the command line, I get the following Fun:

Now that I've been warned (seven times) and notes regarding my poor coding skillz have been appended to my Permanent Record, I'd like to fix Things. The problem is, of course, that I have no idea what's going on. I'm reading the API, trying to figure out where things have gone wrong in ArrayList and Collections counties, but am having no luck.

Here's the class in question:

Adam Altmann

Joined: Jun 08, 2005
Posts: 21

I've managed to "fix" things and get warning-free compiling by adding <String> to the end of ArrayList statements here and there. This is a fantastic development and everything, but I'm still baffled as to why it happened in the first place?

Why did it compile and run fine in Eclipse, yet not cooperate with me at the command-line?

Strange things are afoot at the Circle K.
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

In eclipse, a Java-1.4 is specified as compiler, but in the path, you find a java-1.5 before java-1.4.

Java-generics where introduced with java5, aka java-1.5.
I agree. Here's the link:
subject: Errors with ArrayList? I'm drowning in confusion! *glug* *glug*