Why do java not work?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Niels Koomans
    New Member
    • Apr 2013
    • 14

    Why do java not work?

    Exception in thread "main" java.lang.NoCla ssDefFoundError : showversion
    Caused by: java.lang.Class NotFoundExcepti on: showversion
    at java.net.URLCla ssLoader$1.run( Unknown Source)
    at java.security.A ccessController .doPrivileged(N ative Method)
    at java.net.URLCla ssLoader.findCl ass(Unknown Source)
    at java.lang.Class Loader.loadClas s(Unknown Source)
    at sun.misc.Launch er$AppClassLoad er.loadClass(Un known Source)
    at java.lang.Class Loader.loadClas s(Unknown Source)
    Could not find the main class: showversion. Program will exit.

    I get this error everytime i want to check te version of java, i use java JDK + JRE 1.6.0_45 so i can i build Android with it!

    How can i fix this?
  • Luuk
    Recognized Expert Top Contributor
    • Mar 2012
    • 1043

    #2
    Try:
    Code:
    java -version
    or, if you are actually running some code:
    Code:
    java -showversion somecode.class

    Comment

    • Niels Koomans
      New Member
      • Apr 2013
      • 14

      #3
      I tried that but i still get the error, i use cygwin ( latest version) on windows 8.1 and i want to build Android KitKat

      Comment

      • Nepomuk
        Recognized Expert Specialist
        • Aug 2007
        • 3111

        #4
        You're on Windows 8.1 and still use Java 1.6? That's an odd combination; you should update to 1.7 if possible.

        Also, please tell us the command you're using and which results in the above error. It's no good if we have to guess.

        Comment

        • Niels Koomans
          New Member
          • Apr 2013
          • 14

          #5
          I use the command 'make' to make a android build, but for that i need java 1.6 jdk + jre, it doesn't support java 1.7 JDK + JRE.

          Comment

          • itsraghz
            New Member
            • Mar 2007
            • 124

            #6
            Hi,

            You yourself have an answer. If you are specifically looking for a different version of JRE, directly download it from http://oracle.com.

            However, as far as any software is concerned (not just Java), whatever you are able do to with version x, should definitely be doable with version x+1.

            Comment

            • Nepomuk
              Recognized Expert Specialist
              • Aug 2007
              • 3111

              #7
              I'm guessing you're following these instructions, right? Have you initialized the build and chosen a target? And I also assume you've followed all steps under Initializing the Build Environment, right?

              Comment

              Working...