• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JDK1.5 and PriorityQueue

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

I am a little confused about the usage of JDK1.5 PriorityQueue.
I try to do the following:

PriorityQueue<Integer> pq = new PriorityQueue<Integer>(20);

when I compile on Eclipse, it says: < is an invalida assignment operator
and new should be deleted. Whats wrong with the above assignment? It should
be legal based on 1.5's api doc. Thanks.
 
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you make sure you are using correct JDK for building and running your app?

- Susanta
 
rick collette
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, I set up env and checked it from command prompt, and got
the following:
java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode, sharing)

And Eclipse atomagically detects new JDK version and sets its JRE.
Everything looks fine, duno what went wrong.



Originally posted by Susanta Chatterjee:
Did you make sure you are using correct JDK for building and running your app?

- Susanta

 
rick collette
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Never mind, something must be wrong with my Eclipse settings, seems it only accepts 1.3/1.4 compiler compliance level. Thats the problem.
 
Susanta Chatterjee
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can force eclipse (I just do not remember right now how to) to use external JDK by locating JDK path. I did this before to use JDK 1.5 and worked fine.

- Susanta
[ January 06, 2006: Message edited by: Susanta Chatterjee ]
reply
    Bookmark Topic Watch Topic
  • New Topic