Is there any web site that I could see the source code for the Java standard library? Most so the two classes java.lang.* and java.net.* ??
Please install Java JDK (Java Developer Kit), which is not the same as Java JRE (Java Runtime Environment).
The Java JDK contains the Java source code.
And you'd better to use an IDE (Integrated Development Environment) such as Eclipse or NetBeans to develop Java programs.
You can look for the java code via the IDE tool.
Of course. You could find it in the JDK, but also online. I also use the online version, because I find it faster as to open the folder with the JDK, brows through all the files and so on. Just google "java source object".
http://www.docjar.com/html/api/java/lang/Object.java.html
You need the JDK (JAVA SDK) installed and source of class library is at (on Windows):
C:\<Program Files>\Java\<JDK>\src.zip
Like
C:\Program Files\Java\jdk1.7.0\src.zip
Java source code is available in JDK distribution. If you have installed JDK on your machine, in JDK directory you'll find src.zip. For example, in my windows machine source code is available at: C:\Program Files\Java\jdk1.6.0_12.
Alternatively, you can find Java source code online at: Java Source Code
Thanks,
Mrityunjoy
Related
I have a C/C++ Eclipse. I want to import java project into my C/C++ Eclipse for my development purpose. I have tried importing. But it is not opening as a java file. It is showing the java files as Just text files?
How can i achieve this?
Your C++ version of Eclipse doesn't recognize Java syntax and Java source files. If you want to code in Java, you should download the Java version of Eclipse.
What you need is Java development tools (JDT). You shall check the version of your Eclipse C/C++ first, then install the same version JDT.
Refer this answer https://stackoverflow.com/a/6701354 for install via update site.
You can also download JDT Runtime Binary for offline install.
Just curious about the directory layout for the JDK . So there are two separate java.exe files - one is in:
C:\Program Files (x86)\Java\jdk1.7.0_45\bin
and one is in:
C:\Program Files (x86)\Java\jdk1.7.0_45\jre\bin
Why does there need to be two files ? The motivation for this question arises from some challenge I'm having installing a program(SQL Developer).
There's a difference between installing the jdk vs. the jre.
The jdk package is the developer package and includes tools such as the compiler (javac).
The jre package is the core runtime package, and includes the JVM / runtime environment / whatever you need to run software written in JVM languages.
Here a link to the official Oracle documentation.
The binaries in jdk/bin and jdk/jre/bin are identical. According to the documentation, the PATH should point to jdk/bin.
Here is a link to JDK 7 and JRE 7 Installation Guide
If you want to run Java programs, but not develop them, download the JRE. If you want to develop Java applications, download the Java Development Kit, or JDK. The JDK includes the JRE, so you do not have to download both separately.
I decided to learn JavaFX. I need to browse source code of classes like javafx.scene.layout.StackPane .
So I pressed F3 to go to source code. There is no source code and no button that allows to attach source code.
I looked in the Internet and din't find anything helpful.
I use eclipse kepler and java7.
I have jfxrt.jar in my classpath.
For Java SE 8, the JavaFX source code is distributed with the JDK. If Eclipse does not pick it up automatically, you need to select the zip file using the standard "Attach Source" approach. The file is called javafx-src.zip and is located alongside src.zip in the root of the unpacked Oracle JDK (on Windows).
Recommended - use Java 8 + e(fx)clipse
I believe if you use the recommended e(fx)clipse plugin for JavaFX development and a recent Oracle (Java 8+) JDK, then the Eclipse IDE will automatically be configured to be aware of the JavaFX sources.
Otherwise manually attach sources
If this doesn't work for you, then you can follow JodaStephan's suggestion of attaching sources manually.
For Java 7 users
If you must use Java 7 rather than Java 8, then full source won't be available as JavaFX was only fully open sourced for Java 8. However, you can view some of the source by manually downloading the source code as described at: Where can I download the JavaFX 2.2 source code?, then manually attaching sources. I do not recommend use of Java 7 for JavaFX development or runtime as there were many bug fixes and improvements in Java 8 which are not ported to Java 7.
Disclaimer
I'm not an Eclipse user and haven't tried some of these options.
Is the JRE used by the IBM products like WTX different from the usual ones? When I tried to use a class compiled using usual JVM it doesn't seem to work in WTX.
If so I don't see the JDK in the IBM installed directory to compile my java source. Can someone help me how to get the JDK for the IBM products.
WTX uses it's own JRE.
You can find it on the install dir of the designer.
For example:
C:\Program Files\IBM\WebSphere Transformation Extender X.X\java
Regards,
B.
I have installed Eclipse 3.3 on Mac OS X and it does not contain the src.zip file I am used to seeing with Windows and Linux installations. Where can I download the complete source code for the Java 1.5 JDK (must be specific versions).
I have been able to locate the full source code, however it contained the ungenerated Buffer implementations and so navigating NIO code was not possible.
Looking for the Java source typically found in the JDK src.zip, not the VM source.
You can get the Developer Documentation, which includes the source. The download requires you to have an ADC account.
Brian Clapper has already mentioned it in a comment, but the JDK downloads from Sun include src.zip. I don't know if there's any way to get it other than installing on a target platform, but you can install it on a Windows or Linux (virtual) machine and get src.zip from there.
Specifically for Java 1.5, the downloads are here
[Update]
Also, source distributions of the JDK are available from Sun from here. It seems that SCSL link is messed up and throws you for a loop, but JRL still works (if you don't mind going through it).
It is located in
/System/Library/Frameworks/JavaVM.framework/Versions.1.5.0/Home/src.jar
I do have the XCode stuff installed found on the installation disks that come with a Mac, so I don't know if the source code appears on a standard Mac installation of OSX.
/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/src.jar
More details on:
http://confluence.concord.org/display/CCTR/Get+local+copies+of+Mac+OS+X+Java+source+code+and+Javadoc
Unclear if that is even possible since the Mac JDK is not, to my knowledge, open source. It was created by Apple not Sun.