1

I'm new to Berkeley DB Java Ed. and I'm trying to use it. I have a really simple question. I can't create the Environment for the database. I'm using this code :

EnvironmentConfig envConf = new EnvironmentConfig();
envConf.setAllowCreate(true);
myEnv = new Environment(new File("dbEnv"), envConf);

Even though i've used EnvironmentConfig.setAllowConfig(true), it won't create the needed files :

Exception in thread "main" java.lang.IllegalArgumentException: Environment home dbEnv doesn't exist

I really don't get it :( Any ideas on how to make it create the DB ? Anything else you need to know about my setup ? Thank you for your help !

1 Answers1

2

It will fail if the BDB log directory (in your case the dbEnv dir) is not created in advance.

pjscore10
  • 91
  • 4