hi frnds...pleasehelp in solving it

37 views
Skip to first unread message

sowjanya k

unread,
Apr 19, 2014, 9:50:11 AM4/19/14
to seleniu...@googlegroups.com
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxProfile;
import org.openqa.selenium.firefox.internal.ProfilesIni;

public class test1 {

   
    public static void main(String[] args) {
            ProfilesIni pr=new ProfilesIni();
            FirefoxProfile fp=pr.getProfile("selenium user");
            FirefoxDriver driver=new FirefoxDriver(fp);
            driver.get("http://google.com");
         }
}
even though all my code is right, it is showing the folowing error
xception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$100(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    at test1.main(test1.java:11)

      Regards
      sowjanya




Krishnan Mahadevan

unread,
Apr 21, 2014, 12:52:23 AM4/21/14
to Selenium Users
Please try using JDK1.6 or JDK1.7. 

java.lang.UnsupportedClassVersionError: Bad version number in .class file is java's way of telling you that you are trying to load a class that was compiled with a higher version of Java, than the one that is currently on your machine.

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/997c8add-c624-4726-8018-2e3693c27a4b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Akash Srivastava

unread,
Apr 21, 2014, 6:19:34 AM4/21/14
to seleniu...@googlegroups.com
check ur sdk or jdk version and then compile ypour program again, it was compiled with higher version but executing with lower version.



For more options, visit https://groups.google.com/d/optout.



--
Akash Srivastava
Reply all
Reply to author
Forward
0 new messages