Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 7 of 7

Thread: java run time problem?

  1. #1
    Junior Member
    Join Date
    Jul 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default java run time problem?

    class a
    {
    public static void main(String args[])
    {
    System.out.println("hello");
    }
    }

    am running , de above program.
    but after complilation ,
    if i give "java a " the o/p wont appear.

    i have tried reinstallation and all.

    the same error occurs,

    java.lang.unsupportedclassversionerror a <unsupported major.minor error 50.0>

    jerr.JPG



    pls help me...

    how to resolve dis....


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: java run time problem?

    What version of java are you trying to execute the class file with?
    Is it the same or a younger version than the javac command used to compile it?

  3. #3
    Junior Member
    Join Date
    Jul 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: java run time problem?

    Quote Originally Posted by Norm View Post
    What version of java are you trying to execute the class file with?
    Is it the same or a younger version than the javac command used to compile it?
    javac 1.6.0_26

    java 1.3.1_01

    am using dese versions.

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: java run time problem?

    java 1.3 can NOT execute class files from javac 1.6
    You need to use the java version the same as or later than the javac.
    On windows there is a jre folder in the SDK folders with a java command.
    Last edited by Norm; July 15th, 2011 at 09:10 AM.

  5. #5
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,318
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: java run time problem?

    Look at the command line options for javac, in particular the target option. This will allow you to compile and run on earlier version - provided of course the code does not use classes or libraries which require a later version than the target

  6. #6
    Grand Poobah
    Join Date
    Mar 2011
    Posts
    1,545
    My Mood
    Grumpy
    Thanks
    0
    Thanked 167 Times in 158 Posts

    Default Re: java run time problem?

    Quote Originally Posted by Norm View Post
    You need to use the java version the same as or later than the javac.
    Just a slight modification.
    Improving the world one idiot at a time!

  7. #7
    Junior Member
    Join Date
    Jul 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: java run time problem?

    thanks for dose who replied for me.

    i cant get java version 1.6,but i had installed older version of javac. this may work somewhat.

Similar Threads

  1. [SOLVED] Java run time error: 'java.lang.NullPointerException"
    By ChandanSharma in forum What's Wrong With My Code?
    Replies: 9
    Last Post: June 20th, 2011, 11:53 AM
  2. [SOLVED] Experiencing a run time error, don't know what the problem is
    By scooty199 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: October 3rd, 2010, 10:21 AM
  3. Java Programming Help - thanks ahead of time
    By javanerd in forum What's Wrong With My Code?
    Replies: 5
    Last Post: September 28th, 2010, 04:14 PM
  4. java threading execution time question
    By centenial in forum Threads
    Replies: 4
    Last Post: September 8th, 2010, 11:32 PM
  5. Problem in rotating and moving image at the same time
    By SlimShady in forum What's Wrong With My Code?
    Replies: 10
    Last Post: June 17th, 2010, 02:33 PM

Tags for this Thread