-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?

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
Aezur
  • 331
  • 2
  • 8
  • 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 '13 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 '13 at 12:00
  • what does it say when you try to execute the program? It should rum if it has compiled successfully – Abinash Sinha Jul 26 '13 at 12:03

2 Answers2

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

Community
  • 1
  • 1
Prabhaker A
  • 8,317
  • 1
  • 18
  • 24
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.

Richard Sitze
  • 8,262
  • 3
  • 36
  • 48