Advertisement

02.04.2008 at 11:13AM PST, ID: 23135834
[x]
Attachment Details

javac strange behavior

Asked by DJ_AM_Juicebox in Java Programming Language

Hi,

I made a simple class which compiles fine using jdk 1.5.9 on windows. Now I try compiling on linux (not sure how to check jdk version on here), but I'm getting many errors.  For instance, I have something like:

import java.util.ArrayList;

class TreeNode
{
    ArrayList<TreeNode> m_Children = new ArrayList<TreeNode>();
}

I'm getting errors like:

"The type ArrayList is not generic; it cannot be parameterized with arguments <TreeNode>"
"Syntax error, parameterized types are only available if source level is 5.0"

Any idea what those errors mean? I don't understand why the app compiles and runs fine under a windows JDK distribution. It's  very simple test application, maybe like 200 lines long!

Thanks for any help.Start Free Trial
 
 
[+][-]02.04.2008 at 12:27PM PST, ID: 20817672

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.04.2008 at 01:37PM PST, ID: 20818292

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.04.2008 at 06:56PM PST, ID: 20820262

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Java Programming Language
Sign Up Now!
Solution Provided By: ronghao
Participating Experts: 4
Solution Grade: A
 
 
[+][-]02.05.2008 at 12:24AM PST, ID: 20821433

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.05.2008 at 12:27AM PST, ID: 20821442

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628