File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
JavaRanch » Java Forums » Java » Java in General
Bookmark "Errors with ArrayList? I Watch "Errors with ArrayList? I New topic
Author

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

Adam Altmann
Greenhorn

Joined: Jun 08, 2005
Posts: 21
Hello,

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
Greenhorn

Joined: Jun 08, 2005
Posts: 21
Ok...

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.


http://home.arcor.de/hirnstrom/bewerbung
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Errors with ArrayList? I'm drowning in confusion! *glug* *glug*
 
Similar Threads
Method with Generic Argument
Generics and Warning message
ArrayList error
Doubt i a generics question
Autoboxing / unboxing