• Post Reply Bookmark Topic Watch Topic
  • New Topic

JDK1.5 and PriorityQueue  RSS feed

 
rick collette
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
  • 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.
 
Susanta Chatterjee
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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 ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!