• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

Cannot find symbol Stream

 
Ranch Hand
Posts: 127
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

When I compile below class I am getting following compiler errors:




Compiler Errors:
================================
STest.java:5: error: cannot find symbol
List<String> l = new Arrays.asList("one", "two");
^
symbol: class asList
location: class Arrays
STest.java:6: error: cannot find symbol
Stream<String> sl = l.stream();
^
symbol: class Stream
location: class STest
STest.java:8: error: cannot find symbol
sl.collect(joining(" "));
^
symbol: method joining(String)
location: class STest
3 errors
================================


My JDK Version is: javac 1.8.0_51 and I have streamsupport-1.3.1.jar in $JAVA_HOME/ext/lib directory as well.


Could someone please help?

Thanks in advance !!

Regards,
Raghu
 
author & internet detective
Posts: 41405
854
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Stream id in package java.util.stream rather than java.util. So you need a second import.

Also, there is a stray "new" in the code. Can you find it?
 
Raghavendra Desoju
Ranch Hand
Posts: 127
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Got it, thank you
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic