Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

inline::java Generics won't compile

by The_Dj (Sexton)
on Jul 09, 2013 at 04:56 UTC ( #1043237=perlquestion: print w/replies, xml ) Need Help??

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)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1043237]
Approved by davido
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (2)
As of 2023-06-03 21:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you go to conferences?






    Results (17 votes). Check out past polls.

    Notices?