Results 1 to 4 of 4
  1. #1
    jiayu is offline Member
    Join Date
    Oct 2011
    Posts
    2
    Rep Power
    0

    Default package sun.text.normalizer does not exist

    I am upgrading our java 1.5 application to 1.6.

    In java 1.5 it using sun.text.NormalizerImpl.canonicalDecomposeWithSing leQuotation method. I changed it to 1.6 method sun.text.normalizer.canonicalDecomposeWithSingleQu otation. However, it failed during the build. and got

    package sun.text.normalizer does not exist for the line "import sun.text.normalizer.NormalizerImpl"

    I wrote a small class:


    import sun.text.normalizer.NormalizerImpl;


    public class TestNormalizer {

    public static void main(String [] args)
    {
    String result = NormalizerImpl.canonicalDecomposeWithSingleQuotati on("skfjalsfj");
    System.out.println("Done:");
    }
    }

    and run in the command line using

    java TestNormalizer

    I got two errors


    D:\tmp>javac TestNormalizer.java
    TestNormalizer.java:1: package sun.text.normalizer does not exist
    import sun.text.normalizer.*;
    ^
    TestNormalizer.java:7: cannot find symbol
    symbol : variable NormalizerImpl
    location: class TestNormalizer
    String result = NormalizerImpl.canonicalDecomposeWithSingleQuotati on("skfjalsfj");
    ^
    2 errors

    However, sun.text.normalizer package is in rt.jar under <JAVA_HOME>/jre/lib

    Any idea?

    Jia

  2. #2
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,024
    Blog Entries
    7
    Rep Power
    20

    Default Re: package sun.text.normalizer does not exist

    All packages and classes under the sun.* hierarchy are not part of the public API and you're not supposed to use them.

    kind regarrds,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,565
    Rep Power
    12

    Default Re: package sun.text.normalizer does not exist

    Also those errors don't go with that code.

  4. #4
    jiayu is offline Member
    Join Date
    Oct 2011
    Posts
    2
    Rep Power
    0

    Default Re: package sun.text.normalizer does not exist

    Thanks so much for the reply. Is there any public API we can use to achieve the same function?

    Thanks again,

    Jia

Similar Threads

  1. package jxl does not exist ??? any ideas
    By Macca07 in forum New To Java
    Replies: 5
    Last Post: 05-14-2012, 07:38 PM
  2. package does not exist
    By loja11 in forum New To Java
    Replies: 2
    Last Post: 09-25-2011, 04:26 PM
  3. package does not exist error
    By glaze24 in forum New To Java
    Replies: 1
    Last Post: 11-28-2010, 02:03 PM
  4. package java.text does not exist
    By sknn in forum NetBeans
    Replies: 12
    Last Post: 02-03-2010, 03:14 PM
  5. package mj does not exist
    By PzK in forum New To Java
    Replies: 8
    Last Post: 12-03-2008, 10:30 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •