Could you please advise how the JDK source files can be compiled with debug information using Javac.
I am using the following command:
javac -J-Xms16m -J-Xmx1024m -source 8 -target 8 -sourcepath d:\jdk_src -classpath ".:rt.jar:javax-crypto.jar:ui.jar" -bootclasspath ".:rt.jar:javax-crypto.jar:ui.jar" -d "jdk_debug" -g @filelist.txt >> log.txt 2>&1
Steps to reproduce:
- source and target version is Java 8
- sourcepath holds the directory of all the java classes (extracted from src.zip found in JDK/)
- rt.jar is found in JDK_HOME\jre\lib and holds the required classes that the source code must be compiled against
- filelist.txt contains all the classes found in the src.zip file that must be compiled (extracted using the command
dir /B /S /X jdk_src\*.java > filelist.txt
- we are outputing the logs in log.txt
Instead of the classes being compiled successfully, errors like the following are being raised:
\jdk\jdk_src\java\lang\reflect\AccessibleObject.java:29: error: package sun.reflect does not exist import sun.reflect.Reflection;
\jdk\jdk_src\java\lang\reflect\AccessibleObject.java:30: error: package sun.reflect does not exist import sun.reflect.ReflectionFactory;
\jdk\jdk_src\java\util\jar\Attributes.java:37: error: package >sun.util.logging does not exist
These packages are present in the provided jars (rt.jar, ui.jar and javax-crypto.jar). Could you please explain why the source code is not being compiled since the classpath files are given to the compiler?
Any feedback will be appreciated.
Thank you.