0

I have made a Jar file for a test programm using Selenium's WebDriver.

I just have to run this Jar file (with selenium-server-standalone-2.39.0.jar in the same folder) on my computer and it works fine. But when I try to run it on another computer using java -jar test.jar, I have the following error message :

The error message

I did create a Main class and a correct public static void main(String[] args) method in it.

I don't remember installing anything on my computer to be able to use Selenium before. Is there something to do to run this program ?

3 Answers 3

1

Make sure your java version installed on 2 pcs are the same version (very important)

In thise case , you should reinstall java on 2nd pc with the java version installed on 1st pc.

OR

Install latest version of java on 2nd pc

Sign up to request clarification or add additional context in comments.

Comments

1

The reason is, You have compiled your files in major java Version and try to run in minor java version. Make sure both machines have same version.

Comments

0

Turns out I compiled the program with a 1.8 version of the JDK and I was trying to execute it on a previous version of the JRE.

I solved the problem by upgrading my JRE on the other computer.

I did try to use the -target build parameter but it seemed not to work with BlueJ IDE (I tried to add this line : bluej.compiler.options=-source 1.8 -target 1.5 to the bluej.properties file).

I'm sorry, the problem had nothing to do with Selenium whatsoever.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.