cancel
Showing results for 
Search instead for 
Did you mean: 

Environment variables for Java Applications through Cloud Cockpit

dhorions
Contributor
0 Kudos
908

Hello,

when setting environment Variables as JVM parameters in the Cloud Cockpit, it seems impossible to use these in java application deployed on the tomcat runtime.

Java Code :

logger.info("Environment Variable ENVVAR1 = " + System.getenv("ENVVAR1"));

Log Ouput :

Is there another way to set environment variables, or is there a better way to pass parameters to a java application on hcp?

Thank You,

Dries

View Entire Topic
anton_levin
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Dries,

those you set in Deployment Popup are java system variables and should be accessed with System.getProperty(name)

If you want to use env variables you have to set them with neo console tool (mean -> deploy WAR not from UI but with command line). See --ev argument [1]

Regards,

Anton

[1] SAP HANA Cloud Platform

dhorions
Contributor
0 Kudos

Thanks! That worked perfectly.