Eclipse Question Mac and PC

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sandyw
    New Member
    • Mar 2007
    • 122

    Eclipse Question Mac and PC

    I have a question for Eclipse user.
    I have a PC at work and a Mac at home.
    Do you know if these two operate differently.
    ie for instance the Scanner seems to operate differently. printf is diffrent.
    Maybe that is one reason I can not figure why my projects are not working right.

    sandy
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by sandyw
    I have a question for Eclipse user.
    I have a PC at work and a Mac at home.
    Do you know if these two operate differently.
    ie for instance the Scanner seems to operate differently. printf is diffrent.
    Maybe that is one reason I can not figure why my projects are not working right.

    sandy
    How different are they? Are you getting different results with them?

    Comment

    • sandyw
      New Member
      • Mar 2007
      • 122

      #3
      They will show up as errors unless you add a statement (value or code) to it.

      Comment

      • JosAH
        Recognized Expert MVP
        • Mar 2007
        • 11453

        #4
        Originally posted by sandyw
        They will show up as errors unless you add a statement (value or code) to it.
        Do you have the same runtime version for Java installed on both of your machines?

        kind regards,

        Jos

        Comment

        • sandyw
          New Member
          • Mar 2007
          • 122

          #5
          Originally posted by JosAH
          Do you have the same runtime version for Java installed on both of your machines?

          kind regards,

          Jos

          On my Mac I have 3.2.2 at work I think I have the latest version. Will need to check on that one.
          When I'm using the scanner on the mac it as if I want to: (ie Quick fix)
          import Scanner (com.sun.tools. javac.v8.parser
          import Scanner (sun.tools.jaa
          Create class Scanner
          Create interface scanner
          Change to Signer (java Security
          Create emun Scanner
          rename in faile
          add type parameter Scanner to fid Employee().

          for printf
          change to print(...)
          add cast to System.out
          rename in file

          These are just a few things that seem to be diffrent.

          thanks
          sandy

          Comment

          • JosAH
            Recognized Expert MVP
            • Mar 2007
            • 11453

            #6
            Originally posted by sandyw
            On my Mac I have 3.2.2 at work I think I have the latest version. Will need to check on that one.
            When I'm using the scanner on the mac it as if I want to: (ie Quick fix)
            import Scanner (com.sun.tools. javac.v8.parser
            import Scanner (sun.tools.jaa
            Create class Scanner
            Create interface scanner
            Change to Signer (java Security
            Create emun Scanner
            rename in faile
            add type parameter Scanner to fid Employee().

            for printf
            change to print(...)
            add cast to System.out
            rename in file

            These are just a few things that seem to be diffrent.

            thanks
            sandy
            I was talking about the version of your Java runtime, not Eclipe's version. btw,
            you're not supposed to import anything from com.sun.tools.* yourself. The
            Scanner class is in the package java.util.

            I'm afraid it's an installation issue. The Scanner class is available starting at
            Java 1.5. It seems that on your Mac Eclipse can't find it and accidentally finds
            a Scanner class in the com.sun.tools.j avac package and goed totally berzerk
            afterwards. You're also not supposed to add the tools.jar to Eclipse's build
            path. The tools.jar is for Sun's own JDK (development tools) which isn't needed
            by Eclipse.

            Are you, by any chance, developing JSPs? (just a guess)

            kind regards,

            Jos

            Comment

            • sandyw
              New Member
              • Mar 2007
              • 122

              #7
              Originally posted by JosAH
              I was talking about the version of your Java runtime, not Eclipe's version. btw,
              you're not supposed to import anything from com.sun.tools.* yourself. The
              Scanner class is in the package java.util.

              I'm afraid it's an installation issue. The Scanner class is available starting at
              Java 1.5. It seems that on your Mac Eclipse can't find it and accidentally finds
              a Scanner class in the com.sun.tools.j avac package and goed totally berzerk
              afterwards. You're also not supposed to add the tools.jar to Eclipse's build
              path. The tools.jar is for Sun's own JDK (development tools) which isn't needed
              by Eclipse.

              Are you, by any chance, developing JSPs? (just a guess)

              kind regards,

              Jos
              Hi Jos:
              I did a search on my mac for Java Run time, There was no Java Run time listed. also I don't think I'm develping JSP
              When I'm use eclipe I click on New Projects. I select Java
              Then double click Java Project. I click the next button.
              Type in a Project Name (Employee).
              Click the Finish button.

              When Im in the Project Window
              Under the JRE I'm using the default which is JRE Current jvm 1.4.2
              thanks
              Sandy

              Comment

              • r035198x
                MVP
                • Sep 2006
                • 13225

                #8
                Originally posted by sandyw
                Hi Jos:
                I did a search on my mac for Java Run time, There was no Java Run time listed. also I don't think I'm develping JSP
                When I'm use eclipe I click on New Projects. I select Java
                Then double click Java Project. I click the next button.
                Type in a Project Name (Employee).
                Click the Finish button.

                When Im in the Project Window
                Under the JRE I'm using the default which is JRE Current jvm 1.4.2
                thanks
                Sandy
                Yep, Like Jos said, you will need 1.5 for the java.util.Scann er to work.

                Comment

                • JosAH
                  Recognized Expert MVP
                  • Mar 2007
                  • 11453

                  #9
                  Originally posted by sandyw
                  When Im in the Project Window
                  Under the JRE I'm using the default which is JRE Current jvm 1.4.2
                  thanks
                  Sandy
                  Carefully reread my reply #6 again. Your PC and you Mac run different Java
                  versions. You need at least version 1.5 (you've got that installed on your PC)
                  but your Mac has version 1.4.2. installed which doesn't have a Scanner class.

                  But worse is that Eclipse on your Mac has a wrong builder path, i.e. it can
                  find *another* Scanner thing which actually is part of Sun's tools.jar. Eclipse
                  is not supposed to find that one because it contains packages and classes
                  that are not for public use. You should remove that tools.jar from your build path.

                  kind regards,

                  Jos

                  Comment

                  • sandyw
                    New Member
                    • Mar 2007
                    • 122

                    #10
                    Thanks Jos the info


                    Where do I find the tools.jar. Will it be located in the plug in folder or do I have to find it in the Pref section in Eclipse.

                    Sandy,
                    PS

                    Comment

                    • JosAH
                      Recognized Expert MVP
                      • Mar 2007
                      • 11453

                      #11
                      Originally posted by sandyw
                      Thanks Jos the info


                      Where do I find the tools.jar. Will it be located in the plug in folder or do I have to find it in the Pref section in Eclipse.

                      Sandy,
                      PS
                      Select your project then go to your menu bar and select:
                      Project>Propert ies>Java Build Path. Then select the "libraries" tab and see
                      if that tools.jar is there; if it is, remove it.

                      kind regards,

                      Jos

                      Comment

                      • sandyw
                        New Member
                        • Mar 2007
                        • 122

                        #12
                        Thanks Jos I will look into that one.

                        sandy

                        Comment

                        • sandyw
                          New Member
                          • Mar 2007
                          • 122

                          #13
                          Originally posted by JosAH
                          Select your project then go to your menu bar and select:
                          Project>Propert ies>Java Build Path. Then select the "libraries" tab and see
                          if that tools.jar is there; if it is, remove it.

                          kind regards,

                          Jos
                          Never did find tool.jar in the libraries. There was on item in the library.
                          and I open it to see what was in it. no listing of tools.jar.
                          Sorry I do not have the name of that file.
                          Should I just delete it anyways. On my PC there is no listing at in the library.

                          thanks
                          Sandyw

                          Comment

                          • JosAH
                            Recognized Expert MVP
                            • Mar 2007
                            • 11453

                            #14
                            Originally posted by sandyw
                            Never did find tool.jar in the libraries. There was on item in the library.
                            and I open it to see what was in it. no listing of tools.jar.
                            Sorry I do not have the name of that file.
                            Should I just delete it anyways. On my PC there is no listing at in the library.

                            thanks
                            Sandyw
                            I think (just a guess) that you fell in a silly Sun trap: when you just install
                            a JRE (Java Runtime Environment) you get one JRE/lib directory on your
                            machine. When you install a JDK however (Java Development Kit) you get
                            *two* JREs, one for you and one for internal use. The JDK also has another
                            /lib subdirectory which contains the tools.jar file.

                            Don't remove anything for now but also don't import any class coming from
                            the com.sun.* packages. Not even when Eclipse suggests to do so.

                            I can't give any more detailed help without scrutinizing your installation.

                            kind regards,

                            Jos

                            Comment

                            • sandyw
                              New Member
                              • Mar 2007
                              • 122

                              #15
                              Originally posted by JosAH
                              I think (just a guess) that you fell in a silly Sun trap: when you just install
                              a JRE (Java Runtime Environment) you get one JRE/lib directory on your
                              machine. When you install a JDK however (Java Development Kit) you get
                              *two* JREs, one for you and one for internal use. The JDK also has another
                              /lib subdirectory which contains the tools.jar file.

                              Don't remove anything for now but also don't import any class coming from
                              the com.sun.* packages. Not even when Eclipse suggests to do so.

                              I can't give any more detailed help without scrutinizing your installation.

                              kind regards,

                              Jos
                              Thanks Jos
                              I just going uninstall it and find another version where I have control over it.
                              Thanks again for the time you have given me. We let you know what the out come is.
                              sandyw

                              Comment

                              Working...