eclipseserverderby

Can't get Derby Database to work with mac


I configured the jar file for derby and the json-simple-1.1.1 file but I can't get the Derby to run on eclipse. it says:

Last login: Thu Nov 24 12:39:49 on ttys000 /Users/Adam/Downloads/db-derby-10.13.1.1-bin\ 2/bin/startNetworkServer ; exit; Adams-MacBook-Pro:~ Adam$ /Users/Adam/Downloads/db-derby-10.13.1.1-bin\ 2/bin/startNetworkServer ; exit; Error: JAVA_HOME is not defined correctly. We cannot execute /System/Library/Frameworks/JavaVM.framework/Home/bin/java logout Saving session... ...copying shared history... ...saving history...truncating history files... ...completed.

[Process completed]

every time I try to run startNetworkServer. It's really frustrating I can't find anything online. Derby should work on mac but I don't know what else to do.


Solution

  • Took me 3 days to figure it out I hope it could help others as it helped me. The solution was running the following commands in the terminal:

    export JAVA_HOME=/Library/Java/Home
    

    Path to your Derby folder(Change mine to yours):

    export DERBY_HOME=/Users/Adam/Documents/DERBY/db-derby-10.13.1.1-bin
    

    running the actual file startNetworkServer can't work so you need to run this command:

    java -jar $DERBY_HOME/lib/derbynet.jar start
    

    if everything went well the server should be up and running on port 1527.