6 Replies Latest reply: Feb 18, 2010 3:31 AM by 793415 RSS

    Main Class not found

    843804
      Hi ,

      I have a piece of code which is made for Java 1.5, from which some API got deprecated , changed those API for Java1.6 ,and Compile same in Java 1.6 Environment.
      That is working fine in Java 1.6 . but when I am launching same in Java 1.5 , it is giving me "Main class not found error ".

      Please help me how to resolve this , also is there any way by which i can use same code for both Java version .

      Thanks
      Satendra
        • 1. Re: Main Class not found
          843804
          Hi,
          When you have compiled in JDK 6 then the class version has got changed. So it is obvious JDK 5 runtime will not be able to read it. Which API's you are talking about, if you can provide that, I am sure you will get a better solution.

          regards
          Aniruddha Dutta Chowdhury
          • 2. Re: Main Class not found
            793415
            satendrajain wrote:
            ...I have a piece of code which is made for Java 1.5, from which some API got deprecated , changed those API for Java1.6 ,and Compile same in Java 1.6 Environment.
            That is working fine in Java 1.6 . but when I am launching same in Java 1.5 , it is giving me "Main class not found error ".
            Did the 1.6 API exist in Java 1.5? What exactly was deprecated?
            Please help me how to resolve this , also is there any way by which i can use same code for both Java version .
            Look into the [cross-compilation options|http://java.sun.com/javase/6/docs/technotes/tools/windows/javac.html#crosscomp-options] of the javac tool.
            • 3. Re: Main Class not found
              843804
              Hi ,

              I am using
              Logger.global ()
              toURL()
              show()
              Hide()

              I replaced all the API with their available version.

              Thanks,
              Satendra
              • 4. Re: Main Class not found
                793415
                satendrajain wrote:
                ...I am using
                Logger.global ()
                There is no 'global()' method in either Java 5 or 6 of the java.util.logging.Logger class.
                toURL()
                1) Which of the 3,777 classes of the J2SE does that method come from? Or is guessing part of the 'fun' of helping you?
                show()
                See (1).
                Hide()
                See (1). Though I doubt any method in the J2SE would start with a capital letter.
                • 5. Re: Main Class not found
                  843804
                  Hi ,
                  for global , you can find this
                  http://java.sun.com/javase/6/docs/api/java/util/logging/Logger.html

                  for Hide(), that was by mistake i type in capital latter .

                  Please refer hide().

                  Thanks
                  satendra
                  • 6. Re: Main Class not found
                    793415
                    satendrajain wrote:
                    ...for global , you can find this
                    http://java.sun.com/javase/6/docs/api/java/util/logging/Logger.html
                    Yes, I'm well aware of the JavaDocs. The point is that there is no 'global()' method! Perhaps you were referring to the [Logger.global *field*|http://java.sun.com/javase/6/docs/api/java/util/logging/Logger.html#global]. In which case, you're screwed. The JavaDocs state..
                    Deprecated. Initialization of this field is prone to deadlocks. The field must be initialized by the Logger class initialization which may cause deadlocks with the LogManager class initialization. In such cases two class initialization wait for each other to complete. As of JDK version 1.6, the preferred way to get the global logger object is via the call Logger.getLogger(Logger.GLOBAL_LOGGER_NAME).
                    Then, if you follow the JavaDocs to the definition of [Logger.GLOBAL_LOGGER_NAME|http://java.sun.com/javase/6/docs/api/java/util/logging/Logger.html#GLOBAL_LOGGER_NAME] it states (in part)
                    Since: *1.6*
                    That means the field did not exist in 1.5 JREs, and therefore cannot be used in Java 1.5. You will just have to put up with a deprecation warning until such times as the app. no longer supports 1.5.
                    for Hide(), that was by mistake i type in capital latter .

                    Please refer hide().
                    1) *In which friggin' class?* It sure is not a method of the J2SE Logger class, and I refuse to speculate further based on your (so far) pathetic, incomplete, inaccurate & illogical information.

                    As programmers, the compiler expects us to write code that is exactly what we mean. Is it too much to ask that you extend that precision to Java problems for which you ask for help? Don't expect the compiler, or people who are trying to help you on international forums, to try and 'guess' what you are referring to.

                    The same question (1) applies to the other methods you quoted, I queried you about, yet you ignored., link to the exact class and method you speak of, otherwise I will be unable to offer further help.