http://qs1969.pair.com?node_id=1043237

The_Dj has asked for the wisdom of the Perl Monks concerning the following question:

Turns out I'm stuck on Java 1.4.2_16, but this feature was only added to Java in 1.5 :'(

Compile time failure:
(I've trimmed out quite a lot of the script to be succinct)
Important bits:
use Inline Java => <<'END_OF_JAVA' --snip-- Map<String,Long> myMap = new Map<String,Long>(); --snip--
Then when I check it:
perl -c test.pl --snip-- The error message was: test_pl_185a.java:31: <identifier> expected Map<String,Long> myMap = new Map<String,Long>(); ^ 1 error --snip--
The program runs perfectly with just that Map removed (I'm adding a new feature)

What am I doing wrong?

Replies are listed 'Best First'.
Re: inline::java Generics won't compile
by davido (Cardinal) on Jul 09, 2013 at 05:27 UTC

    What is a "Lomg"?


    Dave

      Typo of "Long"
      Corrected,but the fault persists.
      "Long" is used elsewhere with no problems.
      I've tried with Map<int,int> ... to confirm it's nothing to do with the data types. The same error gets reported.
      (I typed that line for this post. My actual code is using some custom types, but i don't want that to confuse the issue)