eclipse - Environment variable expansion in persistence.xml (JPA) -


I am developing an Eclipse RCP plugin which uses JPA. I tried to specify the database path on the runtime with the variable given to JVM. Property is set correctly, but the database name is created in a folder after the variable name (here: $ {DBHOME}).

  & lt; Property name = "javax.persistence.jdbc.url" value = "jdbc: derby: $ {DBHOME}; make = true" />  

Is there any possibility of this?

thx

This should work, but only for JVM variables, OS Not in the shell / environment variable To work your example, you need to start JVM with -DDBHOME = your / path .

-DDBHOME =% DBHOME% (WIN) JVM launch command line.


Comments