0

I know that I need to set JAVA_HOME & CLASSPATH both before use selenium webdriver but How can I do that in MAC Os?

I have checked my export command and articles related to it but not sure how it works. It is easy with windows os but seems hard to set in MAC Os.

I want to set following in MAC Os AS I did in window :

JAVA_HOME = C:\Program Files\Java\jdk1.8.0_40

CLASSPATH = C:\Program Files\Java\jre1.8.0_51\bin

Helping Hands
  • 5,292
  • 9
  • 60
  • 127
  • what happen if you go to a terminal and type `echo $JAVA_HOME` ? – Thomas Ayoub Sep 21 '15 at 11:55
  • it returns nothing , I have just installed java and finding option to set classpath.. – Helping Hands Sep 21 '15 at 11:56
  • Have you installed a JDK or a JRE? – RealSkeptic Sep 21 '15 at 11:57
  • Ok, and where is located your java SDK ? – Thomas Ayoub Sep 21 '15 at 11:57
  • I have just installed java from here : `https://www.java.com/en/download/help/mac_install.xml` , now really confuse that where it's all files are? so I can get path at least. – Helping Hands Sep 21 '15 at 11:58
  • @Thomas - How can I find those installed files of JAVA ? I mean where is those? For example : in window os we get all files in program files. – Helping Hands Sep 21 '15 at 11:59
  • So that's a JRE you have there. JAVA_HOME is meaningless when you don't have a JDK. You can set CLASSPATH, but it actually should *not* point to the `bin` directory. So you were doing something wrong on your Windows machine. So let's retract and ask - why do you need those variables? – RealSkeptic Sep 21 '15 at 12:04
  • @RealSkeptic - As per selenium webdriver steps it need JAVA_HOME and classpath to be set. – Helping Hands Sep 21 '15 at 12:42
  • Steps where? Can you link? They don't specify the steps by operating system? Anyway, if they insist on JAVA_HOME it means they require that you install the JDK, not the JRE. – RealSkeptic Sep 21 '15 at 12:44
  • Yes I know that require JDK but that is as JAVA_HOME , JRE we need in CLASSPATH variable. – Helping Hands Sep 21 '15 at 12:51
  • I seriously doubt that they need you to install both a JDK and a JRE for Selenium, as the JDK includes a JRE. And as I said, a CLASSPATH that points to the `bin` directory of the JRE doesn't make sense. Where is that link? Add it to your question. – RealSkeptic Sep 21 '15 at 14:09
  • @RealSkeptic - Yes you are right , I just need to JDK to set as classpath for variable JAVA_HOME , but how can I do set that in mac? can you please let me know? – Helping Hands Sep 22 '15 at 04:17
  • Note: download the **JDK** from [Oracle](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html). – RealSkeptic Sep 22 '15 at 04:25
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/90277/discussion-between-helping-hands-and-realskeptic). – Helping Hands Sep 22 '15 at 04:40

0 Answers0