# Java gateway process

**URL:** <https://discuss.hail.is/t/java-gateway-process/1133>\
**Category:** Hail Query & hailctl\
**Created:** [October 17, 2019, 5:03pm UTC](https://discuss.hail.is/t/java-gateway-process/1133 "2019-10-17T17:03:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![drmaly](https://avatars.discourse-cdn.com/v4/letter/d/3be4f8/32.png) [@drmaly](https://discuss.hail.is/u/drmaly)\
**Post date:** [October 17, 2019, 5:03pm UTC](https://discuss.hail.is/t/java-gateway-process/1133/1 "2019-10-17T17:03:25Z")

</div>

Hi,

I am having the following error when I run:

hl.init()

Any idea for solving this issue?

```auto
Exception: Traceback (most recent call last)
<ipython-input-9-1bfe9939c741> in <module>
----> 1 hl.init()
      2 output_notebook()
</home/waamer/anaconda2/envs/hail/lib/python3.7/site-packages/decorator.py:decorator-gen-1203> in init(sc, app_name, master, local, log, quiet, append, min_block_size, branching_factor, tmp_dir, default_reference, idempotent, global_seed, _optimizer_iterations, _backend)

~/anaconda2/envs/hail/lib/python3.7/site-packages/hail/typecheck/check.py in wrapper(__original_func, *args, **kwargs)
    583 def wrapper(__original_func, *args, **kwargs):
    584 args_, kwargs_ = check_all(__original_func, args, kwargs, checkers, is_method=is_method)
--> 585 return __original_func(*args_, **kwargs_)
    586 
    587 return wrapper
~/anaconda2/envs/hail/lib/python3.7/site-packages/hail/context.py in init(sc, app_name, master, local, log, quiet, append, min_block_size, branching_factor, tmp_dir, default_reference, idempotent, global_seed, _optimizer_iterations, _backend)
    262 min_block_size, branching_factor, tmp_dir,
    263 default_reference, idempotent, global_seed,
--> 264 _optimizer_iterations,_backend)
    265 
    266 
</home/waamer/anaconda2/envs/hail/lib/python3.7/site-packages/decorator.py:decorator-gen-1201> in __init__ (self, sc, app_name, master, local, log, quiet, append, min_block_size, branching_factor, tmp_dir, default_reference, idempotent, global_seed, optimizer_iterations, _backend)

~/anaconda2/envs/hail/lib/python3.7/site-packages/hail/typecheck/check.py in wrapper(__original_func, *args, **kwargs)
    583 def wrapper(__original_func, *args, **kwargs):
    584 args_, kwargs_ = check_all(__original_func, args, kwargs, checkers, is_method=is_method)
--> 585 return __original_func(*args_, **kwargs_)
    586 
    587 return wrapper

~/anaconda2/envs/hail/lib/python3.7/site-packages/hail/context.py in __init__ (self, sc, app_name, master, local, log, quiet, append, min_block_size, branching_factor, tmp_dir, default_reference, idempotent, global_seed, optimizer_iterations, _backend)
     50 conf.set('spark.driver.extraClassPath', hail_jar_path)
     51 conf.set('spark.executor.extraClassPath', './hail-all-spark.jar')
---> 52 SparkContext._ensure_initialized(conf=conf)
     53 else:
     54 SparkContext._ensure_initialized()
~/anaconda2/envs/hail/lib/python3.7/site-packages/pyspark/context.py in _ensure_initialized(cls, instance, gateway, conf)
    314 with SparkContext._lock:
    315 if not SparkContext._gateway:
--> 316 SparkContext._gateway = gateway or launch_gateway(conf)
    317 SparkContext._jvm = SparkContext._gateway.jvm
    318 
~/anaconda2/envs/hail/lib/python3.7/site-packages/pyspark/java_gateway.py in launch_gateway(conf)
     44 :return: a JVM gateway
     45 """
---> 46 return _launch_gateway(conf)
     47 
     48 
~/anaconda2/envs/hail/lib/python3.7/site-packages/pyspark/java_gateway.py in _launch_gateway(conf, insecure)
    106 
    107 if not os.path.isfile(conn_info_file):
--> 108 raise Exception("Java gateway process exited before sending its port number")
    109 
    110 with open(conn_info_file, "rb") as info:
Exception: Java gateway process exited before sending its port numbe

```

---

<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:** [October 17, 2019, 5:06pm UTC](https://discuss.hail.is/t/java-gateway-process/1133/2 "2019-10-17T17:06:52Z")

</div>

There’s something wrong with the install of Hail. A few questions:

- in what environment did you install hail? On a laptop? On a cluster? In google cloud dataproc?
- how did you install hail? Did you run `pip install hail`?
- have you ever installed hail before this?
- what version of java do you have? `java -version`

---

<div class="post-metadata">

**Author:** ![drmaly](https://avatars.discourse-cdn.com/v4/letter/d/3be4f8/32.png) [@drmaly](https://discuss.hail.is/u/drmaly)\
**Post date:** [October 17, 2019, 10:46pm UTC](https://discuss.hail.is/t/java-gateway-process/1133/3 "2019-10-17T22:46:44Z")

</div>

Thanks for the prompt reply

The issue is solved now as I was using java 1.9 and installed 1.8. Sorry missed to notice that on the installation guide.

---

<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:** [October 18, 2019, 12:38pm UTC](https://discuss.hail.is/t/java-gateway-process/1133/4 "2019-10-18T12:38:05Z")

</div>

No worries mate, happy hailing.
