Viewing Java source code

Hello all,
I was just wondering if there was a ay for me to view the source code to the java libraries. For example, if I wanted to take a look at the source code for java.util.Iterator how would I do it?
Thanks
Tyler

open the src.zip in your sdk folder.

Similar Messages

  • How to read the Java source code (in Netbeans)

    I use OS X10.5.5, NetBeans 6.1 and JSE 6 on a 64 bit mac.
    When I downloaded NB6.1 it had JSE 5 as it's default (and only) java platform. I ran Software Update to get Java 6 from Apple, used the Java Prefrences utitlity to set JSE6 as default. In NB I added the JDK6 platform, registered the JDK6 javadocs and noticed that I also have the option of registering the Java source code.
    I have three questions:
    1) How do I make JDK6 the default in NetBeans. The JDK5 keeps being default after I did the steps above and I don't see anywhere to change that.
    2) How do I read the Java 6 source code? I can see sun provides [source code| http://download.java.net/jdk6/] for their supported platforms. I dont see Apple doing the same for its JDK port. What would I need to do to get to read the java SE6 sources? or is it actually hiding somewhere in the /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home hierarchy?
    3) Where does the JVM look for the binary code to run when I make a call to, say java.util.ArrayList or any other library. In my naivety I would have assumed it would be a .class file somewhere in the java Home folder, but I don't see anything like it.
    thanks in advance,
    chris

    This is taken from the help included with netbeans. In response to question 1.
    By default, the IDE uses the version of the Java SE platform (JDK) with which the IDE runs as the default Java platform
    for compilation, execution, and debugging. You can view your IDE's JDK version by choosing Help > About and clicking the
    Detail tab. The JDK version is listed in the Java field.
    You can run the IDE with a different JDK version by starting the IDE with the --jdkhome jdk-home-dir switch on the command line
    or in your IDE-HOME/etc/netbeans.conf file. For more information, see IDE Startup Parameters.
    In the IDE, you can register multiple Java platforms and attach Javadoc and source code to each platform. For example, if you
    want to work with the new features introduced in JDK 5.0, you would either run the IDE on JDK 5.0 or register JDK 5.0 as a
    platform and attach the source code and Javadoc to the platform.
    In  , you can switch the target JDK in the Project Properties dialog box. In  , you have to set the target JDK in the Ant script itself,
    then specify the source/binary format in the Project Properties dialog box.
    To register a new Java platform:
    Choose Tools > Java Platforms from the main window.
    Click New Platform and select the directory that contains the Java platform. Java platform directories are marked with a  
    in the file chooser.
    Use the Sources and Javadoc tabs to attach Javadoc documentation and source code for debugging to the platform.
    Click Close.
    To set the default Java platform for a standard project:
    Right-click the project's root node in the Projects window and choose Properties.
    In the Project Properties dialog box, select the Libraries node in the left pane.
    Choose the desired Java platform in the Java Platform combo box.
    Switching the target JDK for a standard project does the following:
    Offers the new target JDK's classes for code completion.
    If available, displays the target JDK's source code and Javadoc documentation.
    Uses the target JDK's executables (javac and java) to compile and execute your application.
    Compiles your source code against the target JDK's libraries.
    If you want to register additional Java platforms with the IDE, you can do so by clicking the Manage Platforms button.
    Then click the Add Platform button and navigate to the desired platform.
    To set the target Java platform for a free-form project:
    In your Ant script, set the target JDK as desired in the javac, java, and javadoc tasks.
    Right-click the project's root node in the Projects window and choose Properties.
    In the Sources panel, set the level of JDK you want your application to be run on in the Source/Binary Format combo box.
    When you access Javadoc or source code for JDK classes, the IDE searches the Java platforms registered in the
    Java Platform Manager for a platform with a matching version number. If no matching platform is found, the IDE's default platform is used instead.
    See Also
    Managing the Classpath
    Declaring the Classpath in a Free-Form Project
    Stepping Through Your Program
    Legal Notices

  • Converting class files into java source codes

    Dear Friends,
    It is true that conversion of class files to its java source codes is possible through some software. I want to know, is there any way to protect my java source codes from viewing or copying illegally by other persons ?
    If I create JAR file from java files, can it be also convertible back to source codes ?
    Avi

    You can use code obfuscators in order to protect your code. And yes a jar file can also be decompiled.
    http://www.retrologic.com/
    http://www.2lkit.com/products/2LKitObf/
    http://www.codingart.com/codeshield.html
    http://www.drjava.de/obfuscator/

  • Viewing the source code

    hi,
    I'm interested in doing some programming in Java but I'm having some real trouble just viewing the source code. First of all, I have a program I would like to look at and I have downloaded the binary files. However, after downloading the Java Development Kit, I still can't find a way to look at the actual source code. I have tried clicking everything in the C:\Program Files\Java\jdk1.6.0_12\bin file but with no avail. Is there a way to look at the actual source code? I've tried writing java but I really need examples in order to learn anything useful. Reading a HOWTO will only get me so far...
    In case you are wondering, the program I have downloaded is called iFreeBudget. Like I said earlier, it's programmed in Java and I have downloaded the binary files but I can't find a way to view the actual code the programmer used to make the program.
    Thanks for your time!
    Mike

    I've tried writing java but I really need examples in order to learn anything useful. Reading a HOWTO will only get me so far...I'm not exactly sure what you mean by a HOWTO but in addition to looking at examples you really should go through the tutorials here .
    From your message I inferred that you are a complete java beginner. I think you will save yourself much confusion and trouble if you take the time to go through the tutorials.
    There are code examples, instructions on how to setup and compile things, and all kinds of explanations of things that you will need to know.

  • Where to find java source code on tiger?

    I'm taking a class on java, and i need to open up some of the java source code for classes like Abstractcollections and Abstractlist to see how their implementations work. Does anyone know where the java folder is located and how to open up the source on a mac? I've seen it done on windows( applications-java-java-sdk - unzip, or something like that), but it is not in the same place place on mac.
    I've searched through the folders named java but could not figure out which folder to open and how.

    Hmmm, are you trying to view the Source Code for Abstractcollections and Abstractlist, or find it, or compile it, or what exactly?
    Source code can be viewed in any text editor, but BBEdit, TextWrangler, & jEdit are really good...
    http://www.barebones.com/products/bbedit/threeway.html
    http://www.barebones.com/products/textwrangler/index.html
    http://www.jedit.org/index.php?page=download

  • How to view the source code for Native Method

    hi
    i am using some native methods in to my code ;
    can anybody tell me how to view the source code for the same ;
    nik

    Buy/acquire a C/C++/assembly code disassembler and run the shared library through it.

  • How to view the source code of JavaFx component ?

    Hi everybody,
    I just want to know if it's possible to view the source code of the component Button (from JavaFx) and how to do it ?
    In fact, I don't really understand if JavaFx is entirely open source ?
    Thanks.

    I lack time right now to experiment, but I think you can get your goal just with CSS.
    Here are the variables I found for Button:
    Button
    borderFill: class javafx.scene.paint.Paint = (null)
    button: class javafx.scene.control.Button = Button
    colorBrightness: Float = 0.8156863
    cornerRadius: Float = 7.0
    fill: class javafx.scene.paint.Paint = (null)
    focusFill: class javafx.scene.paint.Paint = javafx.scene.paint.Color[red=0,green=147,blue=255,opacity=1.0]
    focusSize: Float = 1.4
    highlightFill: class javafx.scene.paint.Paint = (null)
    label: class javafx.scene.control.Label = LabeledImpl [id=-Label]
    paddingBottom: Float = 4.0
    paddingLeft: Float = 10.0
    paddingRight: Float = 10.0
    paddingTop: Float = 4.0
    shadowFill: class javafx.scene.paint.Paint = (null)
    textFill: class javafx.scene.paint.Paint = (null)
    textFont: class javafx.scene.text.Font = Font[name=Verdana, family=Verdana, style=, size=11.0]Try changing cornerRadius and focusFill/highlightFill, etc. Note that some discovered properties are not affected by CSS... Perhaps that's why there isn't an official doc about CSS styling currently.

  • Error in compiling java source code in a package

    hi all...
    am having a problem in compiling a java source code:
    i have a class named 'Test' in the package 'packone'....
    i have another class named 'getTest' in the same package....
    in the class getTest i am taking a reference to Test class...
    on compiling i am getting the following error....
    cannot resolve symbol
    symbol : class Test
    The source code for the two classes are :
    package packone;
    public class Test{
    and
    package packone;
    public class getTest{
    public void me(){
         Test t = new Test();
    i have included the directory path in the classpath....
    still its not compiling .....
    please help
    thanks....

    Assume the current directory structure:
    C:\
    C:\packone...and that your classes are named Test & GetTest.
    My guess is that you're compiling within the directory C:\packone using the command "javac GetTest.java", which is wrong; You must use a path corresponding to the package-name.
    Move your command-line cursor to C:\ and type "javac packone\GetTest.java" and you'll be fine...
    Regards,
      /Håkan

  • Java source code to compare XML based on ExamXML XML diff tool

    I’m working on a project that includes comparing XML files and I need a source code on Java to compare XML fragments.
    I’m using ExamXML from http://www.a7soft.com to compare XML files but I need the Java source code.
    Can anybody help me.

    You didn't notice there's a "Support" link on that page you referred to? Ask them for the source code. If they won't give it to you, then you are effectively asking us to give you a stolen copy of it. Don't ask for such things on this site.

  • W3_PUBLISH_SERVICES and dump while viewing the source code in se80

    Hi,
    external ITS6.20  on SAP R/3 4.7
    we have installed ITS and we published the templates. When we published the teampltes using the standard prgram   W3_PUBLISH_SERVICES, and around 43 of the services fail  Not sure if this is an error
    After the upgrade is finished, you must make this up, before you can use the Internet applications of the system. For a detailed procedure description see Note 399578.
    or not.
    On the other hand when i go to se 80 and try to view the source code of any ITS service lets say PZM3 in my case, the entire application goes for a dump with error
    Exception condition "INVALID PARAM VERB: TEXTSTREAM" raised.
    What happened?
    The current ABAP/4 program encountered an unexpected
    situation.
    What can you do?
    Print out the error message (using the "Print" function)
    and make a note of the actions and input that caused the
    error.
    To resolve the problem, contact your SAP system administrator.
    You can use transaction ST22 (ABAP Dump Analysis) to view and administer
    termination messages, especially those beyond their normal deletion
    date.
    Error analysis
    A RAISE statement in the program "SAPLOLEA " raised the exception
    condition "INVALID PARAM VERB: TEXTSTREAM".
    Since the exception was not intercepted by a superior program
    in the hierarchy, processing was terminated.
    Short description of exception condition:
    For detailed documentation of the exception condition, use
    Transaction SE37 (Function Library). You can take the called
    function module from the display of active calls.
    How to correct the error
    You may able to find an interim solution to the problem
    in the SAP note system. If you have access to the note system yourself,
    use the following search criteria:
    The termination occurred in the ABAP program "SAPLOLEA " in
    "AC_FLUSH_CALL_INTERNAL".
    The main program was "SAPMSEU0 ".
    The termination occurred in line 220 of the source code of the (Include)
    program "LOLEAU10 "
    of the source code of program "LOLEAU10 " (when calling the editor 2200).
    Any deas what the error could be??
    On the other hand i tried to see the Service 'System' and 'webgui' from se80 di dnot find any..
    Any ideas if we are missing in our landscape.
    Message was edited by:
            RajK
    Message was edited by:
            RajK

    Hi RajK
    > On the other hand i tried to see the Service 'System'
    > and 'webgui' from se80 di dnot find any..
    > Any ideas if we are missing in our landscape.
    The services system and webgui are shipped within the installer of ITS 6.20. So you can't find them in the database via SE80, instead only in the filesystem.
    Not your main problem, I know, but I just wanted to clarify.
    Best regards,
    Henning

  • How to beautify Java source code

    Hello!
    I'm mostly a Java developer, and I recently moved my projects to XCode. I was using jEdit previously, with a lot of plugins. I specially miss:
    * the ability to do vertical selections (jEdit, TextMate)
    * Gruntspud CVS plugin - but this can be run standalone, and I configured the default action to be /usr/bin/open so it opens the source and project files in Xcode.
    * and JavaStyle !!! This plugin "beautifies" Java source code. Sometimes, tabs are messed up and I want to clean up the code.
    Is there any JavaStyle-like plugin for XCode?

    * the ability to do vertical selections (jEdit,
    TextMate)
    Supposedly you can install 3rd party editors in Xcode. I have never done it though.
    * Gruntspud CVS plugin - but this can be run
    standalone, and I configured the default action to be
    /usr/bin/open so it opens the source and project
    files in Xcode.
    Xcode comes with a CVS plug in. Have you tried turning on SCM for your project?
    * and JavaStyle !!! This plugin "beautifies" Java
    source code. Sometimes, tabs are messed up and I want
    to clean up the code.
    I expect that a Java tool like JavaStyle would run from the command line. If so, you can probably wrap it in a script and install it in Xcode's script menu.

  • How can I view the source code of chrome://browser/content/browser.xul?

    How can I view the source code of chrome://browser/content/browser.xul of mobile FireFox?
    In my desktop version I just open this page in new tab and view webpage source, but there is no option for FF mobile to view source code.
    Best regards.

    Does the view-source: protocol work on mobile?
    *view-source:chrome://browser/content/browser.xul

  • Where to download Java Source Code of Libraries?

    Hi Sir/Madam,
    Would you please tell me where can I get the Java source code of Libraries?
    Specifically for package sap.comcrmtcuserassembly.jar?
    I tried to look on to Downloads and Search but can't find it.
    Thank you very much in advance.
    -jemaru

    I've found it, the source codes are downloaded at:
    C:\usr\sap\J2E\JC00\j2ee\cluster\server0\apps\sap.com\

  • Protecting java source code

    I heard about the possibilty of decompiling the java code and getting back the source code, is this flaw specific to java or is it common among all programming langauges?
    how is it possible to protect the source code? and how expensive is the solution?
    thank you

    Back to poster: To my knowledge, the ability tode-compile back to valid source code is unique to
    Java.
    No it's not. Any program files can be decompiledback
    to source code.
    If not their original C or C++ code, then at least
    assembly code.You cannot decompile C or C++ code to anything but
    assembler language. Which even when written by a good
    programmer is considered obfuscated by others. I
    doubt that anyone has lifted C or C++ code from
    another application using a decompiler.yes you can, all binaries can be reverse compiled, logically speaking they have to be!
    However, the readability of the output is not going to be as high as that obtained from decompiled java.
    >
    I would say that de-compilation is not a flaw in Javawhen compared to
    powerful features it has to offer. Of course it's a flaw (so I disagree with you here).
    People don't want this behavior, but it exists. As I
    stated earlier (and I'm agreeing with you on this
    one), it was an issue of priorites, and the
    developers of Java decided that it was OK because it
    allowed "powerful features"...it is a feature - whether it is a desirable feature is another argument entirely.
    >
    Here's a list of projects where the developers arenot interested in
    hiding the source code from you, in fact they let youhave it for free:
    Notice the words developers, not software companies.
    I believe in open source and participate in it when
    not bound by non-disclosure which is 99% of the time.
    But I would stand by my statement that there are no
    o software companies selling retail software that
    believe the ability to decompile Java back to Java
    source code is OK or good for them in anyway. I would
    gently suggest that providing open source code, and
    providing the ability to decompile to source code
    really don't belong in the same discussion...Protecting code is not the job of programmers, it is the job of the Law.
    rob,

  • Issue of Security about Java Source Code

    At most time Java compiler compiles the *.java source code into *.class files and then pack them in *.jar files running in the Java VM or as applet running on web pages.
    Recently I find a tool named cavaj that can decompile *.class files into *.java files. I tried it to decompile my *.class files and unvealed that the decompiled *.java files are the same of my source code!
    How to protect the source code not to be pirated? This is a big problem about the mechanism of Java. Is there any tool to compile *.java to *.exe files? Or is there any tool that can decompile *.exe to *.java in the future?

    This is a common question. If you do a search you will find many answers/solutions.
    But can it affect the performance of the program? Your program mayload slight faster, but the runtime performance is the same. It may effect your performance as it takes some time to get the obsufaction right, especially if you are using reflection.

Maybe you are looking for