2

I am developing a Eclipse RCP plugin which uses JPA. I tried to specify the database path via a variable give to the JVM on runtime. The property is set correctly but the database is created in a folder named after the variable name (here: ${DBHOME}).

<property name="javax.persistence.jdbc.url" value="jdbc:derby:${DBHOME};create=true"/>

Is there a possibility to fix this?

Thx

Pascal Thivent
  • 562,542
  • 136
  • 1,062
  • 1,124
user342495
  • 1,453
  • 1
  • 11
  • 10

1 Answers1

2

That should work but only for JVM variables, not OS/Shell environment variables. To make your example work, you need to start the JVM with -DDBHOME=your/path.

To make this work with shell variables, you need to add -DDBHOME=$DBHOME (*nix) or -DDBHOME=%DBHOME% (win) to the JVM launch command line.

Tim Sylvester
  • 22,897
  • 2
  • 80
  • 94