• Post Reply Bookmark Topic Watch Topic
  • New Topic

Java 8 update 66 cannot find symbol com.sun.org.apache.xalan.internal.xsltc.runtime.Hashtable  RSS feed

 
Raghavendra Badveeti
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using com.sun.org.apache.xalan.internal.xsltc.runtime.Hashtable class.

With latest java update (Java8u66) this API got removed.

So i am getting "cannot find symbol com.sun.org.apache.xalan.internal.xsltc.runtime.Hashtable " error during compilation.

I am trying for alternative Class / API . Could any one help me on this.




Sample Code



import com.sun.org.apache.xalan.internal.xsltc.runtime.Hashtable;
import java.util.LinkedList;


private LinkedList<Object> tableList = null;
private Hashtable toolTipHash = new Hashtable();

.....................
......


LinkedList rowList = (LinkedList)tableList.get(dataRowIndex);

if (!(toolTipHash.containsKey(rowList)))
{

..................
.....




Thanks,
Raghavendra.
 
Campbell Ritchie
Sheriff
Posts: 53774
128
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why do you want to use a Hashtable in the first place? Use a HashMap.
Don't use packages beginning sun and beware of using packages beginning com.sun, as mentioned in this SO thread. You may need to install JavaEE as well as Java8. Alternatively you may want the classes of similar names in the java.util package.
Or, this appears to be the Apache hash table. Different package name. You would probably have to download it from the Apache site and add it to your classpath.
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 15862
81
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you import the wrong Hashtable? You should probably have used java.util.Hashtable instead of the one in a com.sun... package. And Campbell is right that you should really have used HashMap instead of Hashtable - because Hashtable is a legacy collection class that has been replaced with HashMap since Java 1.2.

Note that everything inside sun.* and com.sun.* and any other package that is not documented in the API documentation is not part of the public API and should not be used in any program you write. Those classes may be modified or removed in future Java versions without warning.

See Oracle's note about this: Why Developers Should Not Write Programs That Call 'sun' Packages.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!