I have python code that works just fine in multiple other places and "used" to work on my mac, but now when I try to run my code as:
python <pythonfile>.py
I get an error which says:
No Java runtime present, requesting install.
I have tried all of the fixes on SO and installed the latest Java JDK. The only thing I haven't done is reboot as I'm right in the middle of a lot of things.
Any ideas?
Java JDK
java version "11.0.2" 2018-10-16 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.2+7-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.2+7-LTS, mixed mode)
Python
mbp-1056:site-packages$ python --version
Python 2.7.10
mbp-1056:site-packages$ type -p python
/usr/bin/python
Code
import time
import json
from confluent_kafka import Producer
from hl7_to_dict import hl7_str_to_dict
#Set up my producer
p = Producer({'streams.producer.default.stream': '/demos/hl7demo/hl7stream'})
str_msg=''
with open("hl7_records_random.txt") as f:
for line in f:
if line!='\n':
str_msg=str_msg+line
else:
#print(str_msg)
d = hl7_str_to_dict(str_msg)
print json.dumps(d)
print ("\n\n")
json_hl7 = json.dumps(d)
p.produce('allMessages', json_hl7)
p.produce('adt_topic', json_hl7)
# Or - just do a json.dumps(your_json) instead of str_msg
p.flush()
str_msg=''
time.sleep(5)
python --version
show andtype -p python
from confluent_kafka import Producer
as what I have written is a Kafka producer, but I still don't understand the Java link.