0

I know so many have posted this question here, and I tried their solutions but can't make it work. All projects I debug get this "source not found" whenever I press f5. I've just created a simple app like: System.out.println("test"); It runs, but when I debug "source not found" always appears. I'm new to this. I have no idea what to do. Here's the stack trace:

Class<T>.getDeclaredMethods0(boolean) line: not available [native method
Class<T>.privateGetDeclaredMethods(boolean) line: not available
Class<T>.getMethod0(String, Class<?>[]) line: not available
Class<T>.getMethod(String, Class<?>...) line: not available
LauncherHelper.getMainMethod(PrintStream, Class<?>) line: not available
LauncherHelper.checkAndLoadMain(boolean, int, String) line: not available
C:\Program Files\Java\jre7\bin\javaw.exe (Oct 24, 2013 12:22:07 AM)
sample.java Class<T>.getDeclaredMethods0(boolean) line: not available [native method] Outline
Source not found. An outline is not available

Thanks in advance.

wormwood
  • 441
  • 4
  • 9
  • 17

1 Answers1

1

Indeed source is not available. You are using JRE to run the program and it is the compiled code.

You have two options

  1. Download the source and attach it to the jar during debugging. Attach the Source in Eclipse of a jar
  2. Use JAD to decompile the class file automatically. http://www.mkyong.com/java/java-decompiler-plugin-for-eclipse/
Community
  • 1
  • 1
Abhijith Nagarajan
  • 3,865
  • 18
  • 23
  • what if I change the path so it would not run on jre? Will it work? Can I do that? – wormwood Oct 23 '13 at 17:12
  • Without JRE you cannot run a java program. Why do you want to see the code of System.out.println. println method internally uses native code(code written in c) to write to the console. – Abhijith Nagarajan Oct 24 '13 at 08:43