I open this file with ANSIC code,so how can I solve this problem?
Asked
Active
Viewed 937 times
1 Answers
1
That is not Java source code.
.class files are compiled Java binary class files.
.java files have the source code.
If you are looking for the source code of the Java compiler (javac), you can get that from OpenJDK. But it's a big and complex project.

Thilo
- 257,207
- 101
- 511
- 656
-
so your mean is that I should open with a .java file notepad++,and can't open with a .class file in notepad++? – 秦文茂 Jan 22 '16 at 12:19
-
Yes, you cannot read a .class file. It is a binary file (like an .exe or a .jpg). – Thilo Jan 22 '16 at 12:21
-
-
a) yes, checked the linked question provided in comments. b) in this case: why? the source code is freely available at OpenJDK – Thilo Jan 22 '16 at 12:27
-
yeah, I open this linked in my browser ,but I can't find a way to serch for javac.exe's .java file.Is there any way? – 秦文茂 Jan 22 '16 at 12:30
-
That's a couple of hundred source files at least... Here is the `public static void main` for javac: http://hg.openjdk.java.net/jdk8/jdk8/langtools/file/1ff9d5118aae/src/share/classes/com/sun/tools/javac/Main.java – Thilo Jan 22 '16 at 12:35
-
And here are some notes for newcomers to javac source: http://openjdk.java.net/groups/compiler/doc/hhgtjavac/index.html – Thilo Jan 22 '16 at 12:36
-
-
What exactly are you looking for? You can download the source and browse it in an IDE more conveniently than in a text editor. – Thilo Jan 22 '16 at 12:40
-
well,I just mean how can you find javac 's .java file so quickly in the linked you gaven to me before ? – 秦文茂 Jan 22 '16 at 12:41
-
there is "browse" in the side menu. That shows the tree of files (similar to the one in your screenshot). – Thilo Jan 22 '16 at 12:42
-
but there is so much,I can't figure out which is javac without the linked you just give me before,sad – 秦文茂 Jan 22 '16 at 12:48