It has something to do with the driver.get(url); line of code.
I don't know enough to capture errors and display or handle them yet.
Can you tell me my mistake?
It makes sense that I should have included the log. I can see that something is wrong with a version of something. I'll guess it is Selenium, Java, or the Chrome Driver.
If you cannot tell from the log what is possibly wrong I can start collecting the files I'm using for the setup.
It was suggested to me from my training school that I change the settings to:
Project -> Properties -> Java Compiler Enable project specific settings. Then select Compiler Compliance Level to 1.8, 1.8 and 1.8 as per the jdk version that you have instaled in your system, build and test your app
It seems to make things worse because I am getting the error message when I try to run other scripts in Eclipse that used to work.
Exception in thread "main" java.lang.UnsupportedClassVersionError: module3/Module3_Assignment : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.security.AccessController.doPrivileged(Native Method)
If the class file was created with version 8, it can't be executed with version 7 of the java program. The yellow flagged message in the image says currently 1.7
Campbell Ritchie wrote:That problem is usually caused by a newer version of javac than the version of java. Please try the following instructions at the command line:-You will probably have to alter your system PATH to correct that problem, so look through your PATH for folders which might contain Java® runtimes.
Java says 1.8.0_151 and other lines that mention build of the same numbers.
javac says 1.8.0-151
Path contains c:\program files\java\jdk1.8.0_150 I have to look again for the JRE.
Path contains c:\program files\java\jdk1.8.0_150
If that is a complete path from the Path variable, it does not reach to the bin folder where the javac.exe file is so the OS would not be able to find the javac.exe file to be able to execute it.
Check the contents of Path again. Also look for another path for any java programs so the OS can find the java.exe file.
Also why do the -version responses say 151 but the path says 150?
Eclipse preferences > Java > Installed JREs.
in the Selenium Menu and I could not find a file with the name eclipse preferences.
i found an answer on Stack Overflow that showed how to export the files. Code ranch won't allow me to attach an .epf file so I pasted the contents below. I see it mentioning 1.7 and not 1.8. I"m going to go to sleep now. I will check the thread tomorrow. Also I see that you copies the thread from the Java area to here. i don't know how you did that.
#Fri Feb 02 23:33:42 EST 2018
/instance/org.eclipse.jdt.launching/org.eclipse.jdt.launching.PREF_VM_XML=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?>\r\n<vmSettings defaultVM\="57,org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType13,1462756018616" defaultVMConnector\="">\r\n<vmType id\="org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType">\r\n<vm id\="1462756018616" name\="jdk1.7.0_45" path\="C\:\\Program Files\\Java\\jdk1.7.0_45"/>\r\n</vmType>\r\n</vmSettings>\r\n
/instance/org.eclipse.jdt.ui/org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates/>
Additional to the JDK versions that projects can use, Eclipse is written in Java, so there's another possible JDK version. I don't think that the JDK that Eclipse runs under has to actually be an installed (project-usable) VM, but that's certainly the common case. Especially if you only have one version of Java installed on your machine to begin with!
It's actually dead easy to install a JVM. Their base format is a simple ZIP file, so you can download and unzip it and you're good to go. Some distros, such as the Red Hat RPM package go one step further and add links to make it more compliant with local OS conventions, but that's just icing and doesn't afffect the base layout. The Red Hat convention is to make the different JDK and JVM directories under /usr/java, but Java doesn't actually care where you put it, as long as the apps have been told where to find it. JAVA_HOME is a popular environment variable often used for that purpose - although it's not actually part of any official spec.
Once you've installed Java, you can configure it as an available compiler as Knute indicated (in other words, you give it an identifying name and the path to that directory) and/or you can configure Eclipse to start up under it.
So the whole thing is actually fairly simple and the only real issue is if you do something like attempt to employ a plug-in that requires a newer version of Java than the one you're running under.