I would like to connect to a Heroku Database and I tried to replicate the model like their tutorial: https://devcenter.heroku.com/articles/connecting-to-relational-databases-on-heroku-with-java#using-the-jdbc_database_url
When below line is executed
URI dbUri = new URI(System.getenv("postgresql://osnvehqhufnxzr:TS3Qt37c_HHbGRNKw3yk7g88fp@ec2-54-225-93-34.compute-1.amazonaws.com:5432/d39mfq0odt56bv?ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory"));
I am getting the error
java.lang.NullPointerException
at java.net.URI$Parser.parse(Unknown Source)
at java.net.URI.<init>(Unknown Source)
How is this caused and how can I solve it?