# Java version incompatibility

**URL:** <https://discuss.hail.is/t/java-version-incompatibility/1527>\
**Category:** Hail Query & hailctl\
**Created:** [July 12, 2020, 10:41pm UTC](https://discuss.hail.is/t/java-version-incompatibility/1527 "2020-07-12T22:41:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ldiambra](https://avatars.discourse-cdn.com/v4/letter/l/e495f1/32.png) [@ldiambra](https://discuss.hail.is/u/ldiambra)\
**Post date:** [July 12, 2020, 10:41pm UTC](https://discuss.hail.is/t/java-version-incompatibility/1527/1 "2020-07-12T22:41:19Z")

</div>

Hi  
I am atte,ting to run my first query to test the installation. I am using a linux mint. on the prompt of python3 after import hail, I have the response, I can understand the output, please can you help me

> > > hail.init()  
> > > 2020-07-12 18:45:26 WARN Utils:66 - Your hostname, luis-home resolves to a loopback address: 127.0.1.1; using 192.168.0.6 instead (on interface wlp3s0)  
> > > 2020-07-12 18:45:26 WARN Utils:66 - Set SPARK\_LOCAL\_IP if you need to bind to another address  
> > > WARNING: An illegal reflective access operation has occurred  
> > > WARNING: Illegal reflective access by org.apache.spark.unsafe.Platform (file:/home/luis/.local/lib/python3.6/site-packages/pyspark/jars/spark-unsafe\_2.11-2.4.1.jar) to method java.nio.Bits.unaligned()  
> > > WARNING: Please consider reporting this to the maintainers of org.apache.spark.unsafe.Platform  
> > > WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations  
> > > WARNING: All illegal access operations will be denied in a future release  
> > > 2020-07-12 18:45:26 WARN NativeCodeLoader:62 - Unable to load native-hadoop library for your platform… using builtin-java classes where applicable  
> > > Setting default log level to “WARN”.  
> > > To adjust logging level use sc.setLogLevel(newLevel). For SparkR, use setLogLevel(newLevel).  
> > > 2020-07-12 18:45:27 WARN Hail:37 - This Hail JAR was compiled for Spark 2.4.5, running with Spark 2.4.1.  
> > > Compatibility is not guaranteed.  
> > > Traceback (most recent call last):  
> > > File “”, line 1, in   
> > > File “”, line 2, in init  
> > > File “/home/luis/.local/lib/python3.6/site-packages/hail/typecheck/check.py”, line 614, in wrapper  
> > > return _original\_func(\*args, \*\*kwargs_)  
> > > File “/home/luis/.local/lib/python3.6/site-packages/hail/context.py”, line 228, in init  
> > > skip\_logging\_configuration, optimizer\_iterations)  
> > > File “/home/luis/.local/lib/python3.6/site-packages/hail/backend/spark\_backend.py”, line 195, in **init**  
> > > self.\_jbackend, log, True, append, branching\_factor, skip\_logging\_configuration, optimizer\_iterations)  
> > > File “/home/luis/.local/lib/python3.6/site-packages/py4j/java\_gateway.py”, line 1257, in **call**  
> > > answer, self.gateway\_client, self.target\_id, self.name)  
> > > File “/home/luis/.local/lib/python3.6/site-packages/py4j/protocol.py”, line 328, in get\_return\_value  
> > > format(target\_id, “.”, name), value)  
> > > py4j.protocol.Py4JJavaError: An error occurred while calling z:is.hail.HailContext.apply.  
> > > : is.hail.utils.HailException: Hail requires Java 8, found 11.0.7  
> > > at is.hail.utils.ErrorHandling$class.fatal(ErrorHandling.scala:9)  
> > > at is.hail.utils.package$.fatal(package.scala:77)  
> > > at is.hail.HailContext$.checkJavaVersion(HailContext.scala:93)  
> > > at is.hail.HailContext$.apply(HailContext.scala:129)  
> > > at is.hail.HailContext.apply(HailContext.scala)  
> > > at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
> > > at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)  
> > > at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)  
> > > at java.base/java.lang.reflect.Method.invoke(Method.java:566)  
> > > at py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:244)  
> > > at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:357)  
> > > at py4j.Gateway.invoke(Gateway.java:282)  
> > > at py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:132)  
> > > at py4j.commands.CallCommand.execute(CallCommand.java:79)  
> > > at py4j.GatewayConnection.run(GatewayConnection.java:238)  
> > > at java.base/java.lang.Thread.run(Thread.java:834)

---

<div class="post-metadata">

**Author:** ![danking](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/danking/32/43_2.png) [@danking](https://discuss.hail.is/u/danking)\
**Post date:** [July 13, 2020, 3:57am UTC](https://discuss.hail.is/t/java-version-incompatibility/1527/2 "2020-07-13T03:57:31Z")

</div>

Hi @ldiambra,

I’m sorry you’re having trouble with Hail. The issue is buried a little bit, but the root cause is here:

> [@ldiambra](#):
>
> : is.hail.utils.HailException: Hail requires Java 8, found 11.0.7

You have to install Java 8 and ensure it is the default Java version. You might need to investigate `update-alternatives`

---

<div class="post-metadata">

**Author:** ![ldiambra](https://avatars.discourse-cdn.com/v4/letter/l/e495f1/32.png) [@ldiambra](https://discuss.hail.is/u/ldiambra)\
**Post date:** [July 13, 2020, 1:59pm UTC](https://discuss.hail.is/t/java-version-incompatibility/1527/3 "2020-07-13T13:59:45Z")

</div>

Thank you very much, I installed java version 8 but it was not as default. Now I am resolved with  
sudo update-alternatives --config java

---

<div class="post-metadata">

**Author:** ![farshad](https://avatars.discourse-cdn.com/v4/letter/f/bbe5ce/32.png) [@farshad](https://discuss.hail.is/u/farshad)\
**Post date:** [May 24, 2021, 8:49pm UTC](https://discuss.hail.is/t/java-version-incompatibility/1527/4 "2021-05-24T20:49:57Z")

</div>

worked for me as well. Thank you.
