7 Replies Latest reply: Nov 14, 2008 2:13 AM by 807589 RSS

    the src.zip file

    807589
      hi guys

      I'm rather a beginner to Java.

      I posted a question related to this one on another section.
      I'd like to know about the src.zip file

      Is it essential to set up your JRE_SRC variable to point to the src.zip file?

      What is the purpose of src.zip?

      If we want to reference types such as String or Boolean or Integer, do we need to have src.zip set up?

      Thanks very much
        • 1. Re: the src.zip file
          807589
          I have no idea what the JRE_SRC variable is
          I have no idea what you mean by "have src.zip set up"

          The src.zip file contains all the source code of all the classes in the Java API. Want to see what the code for the String class looks like? Then open up src.zip and have a browse.
          • 2. Re: the src.zip file
            807589
            I'm not sure what JRE_SRC does as i've seen very limited documentation but from my understanding it's the java runtime source and is supposed to contain the src.zip file. That's what i gather from the documentation

            flounder, is src.zip necessary in order to reference classes in the packages that it contains?
            In one place I read that it is necessary but in another place I read that it's just the source code to the classes that are compiled and located elsewhere in the jdk.

            thanks
            • 3. Re: the src.zip file
              807589
              Shane7070 wrote:
              I'm not sure what JRE_SRC does as i've seen very limited documentation but from my understanding it's the java runtime source and is supposed to contain the src.zip file. That's what i gather from the documentation
              Are you talking about some folder/directory? As I said I have never heard of it.
              flounder, is src.zip necessary in order to reference classes in the packages that it contains?
              In one place I read that it is necessary but in another place I read that it's just the source code to the classes that are compiled and located elsewhere in the jdk.
              As I said the src.zip file contains the source code, that is the .java files. To run Java programs you need the .class files and these have been placed inside a .jar file.
              • 4. Re: the src.zip file
                807589
                Who told you to define JRE_SRC, and why?
                • 5. Re: the src.zip file
                  807589
                  I see.So basically only if something is of the .class format, it can be referenced.

                  JRE_SRC seems to be some setting which is shown by Eclipse. In that particular section of Eclipse, it allows you to configure JRE_SRC, JRE_SRCROOT and JRE_LIB.

                  But I guess it's not critical in terms of running the code since it's just .java files as oppose to .class files.


                  Thanks mate.
                  • 6. Re: the src.zip file
                    807589
                    DrLaszlo,

                    Originally my colleague's code was compiling but mine wasn't. We both checked it out of the same repository and our environment variables etc. seemed to be the same. The only difference I noticed was with this JRE_SRC as his one had .../src.zip and mine was just empty.

                    But i'm thinking my problem is to do with something else now because when I create a new Java project and make reference to some of the Types, they compile. This is in contrast to when they don't compile in that other project.
                    • 7. Re: the src.zip file
                      807589
                      src.zip contains the Java source codes of the Java platform. For example, you will get String.java or JFrame.java inside.