Search code examples
javaeclipsecompiler-warningstextpad

Java class won't work outside eclipse


My program runs fine under eclipse. If I open it with the textPad and compile it, I get this message:

Note: C:\Users\Aezur\Desktop\Project2\SummerQ1.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details.

It says that has compiled successfully, but it doesn't run.

Any ideas?


Solution

  • It is just Warring,do not have any affect on compilation or execution.
    Accorind to Java Doc

    -Xlint:unchecked  
    Give more detail for unchecked conversion warnings that are mandated by the Java Language Specification.
    

    Generally This comes up in Java 5 and later if you're using collections without type specifiers.
    Example : using Arraylist() instead of Arraylist<String>().

    You can avoid that warring by using @SuppressWarnings("unchecked").

    class NoWarn {
       public static Map<String, String[]> getParameterMap(ServletRequest r) 
       {
          @SuppressWarnings("unchecked")
          Map<String, String[]> result = r.getParameterMap();
          return result;
        }
     }
    

    For more information please look into this link