Hi,

My java program runs fine on eclipse but when I run it on another system which has Java 1.4.2 I am not able to run it. I am using vectors in my program.It is not able to recognize vectors.


'.class' expected
Vector<int[]> resulttest = new Vector<int[]>();

hello.java:199: not a statement
Vector<int[]> resultk = new Vector<int[]>();

Thanks.

The <int[]> syntax was new in Java 1.5, so it won't compile on earlier JDKs. You can compile using 1.5/1.6 compilers, but the generated .class files will also need JRE 1.5/1.6 unless you specify that the generated class files must be compatible with earlier JREs.
In Eclipse go to Project Properties / Compiler / generated .class file compatibility.

ps Anyone running 1.4.2 is missing quite a few years' worth of bug fixes and security patches (it was replaced in 2004), and needs to update to a current version as a matter of top priority!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.