-1

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?

3
  • 5
    That's a warning, not a compile error. I assume it's creating a .class file? What do you mean by "it won't run"?
    – Joe
    Jul 26, 2013 at 11:59
  • 2
    How do you run your application? What happened when you cannot run application? Warning doesn't affect compile stage at all.
    – Taky
    Jul 26, 2013 at 12:00
  • what does it say when you try to execute the program? It should rum if it has compiled successfully Jul 26, 2013 at 12:03

2 Answers 2

0

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

0

You'll find compiler behavior from Eclipse vs standalone compiling varies because:

  • Eclipse has it's own internal compiler; it doesn't use the standard Oracle Java compiler.

  • The Eclipse Java compiler allows a relatively high degree of settings to ignore, warn or generate an errora for many coding issues.

Not the answer you're looking for? Browse other questions tagged or ask your own question.