Unable to start derby database from Netbeans 7.4

前端 未结 12 736
栀梦
栀梦 2020-12-04 12:21

I downloaded Netbeans 7.4 and Java 7 Update 51. I get the below error when I try to start Java DB or derby connection from Netbeans. This is on a windows 8 PC. I downloaded

12条回答
  •  时光说笑
    2020-12-04 12:47

    This is what I did:

    1. Find out exactly where the java home is by executing this instruction from NetBeans 7.4 :

      System.out.println(System.getProperty("java.home"));

      This is the output for my case:

      C:\Program Files\Java\jdk1.7.0_51\jre

      which is quite important for me, I was modifying another java.policy and took no effect and wasted me a couple of hours.

    2. For reason of java.policy is an unix style file and read-only, I opened and edited it with notepad++ and executed as administrator (under the same java home):

      C:\Program Files\Java\jdk1.7.0_51\jre\lib\security\java.policy

      Add only these lines into the file after the first grant:

      grant {
          permission java.net.SocketPermission "localhost:1527", "listen";
      };
    3. Save the file, which is a little tricky for reason of the permission. But if you run notepad++ or any other edit program as administrator, you can solve the problem.

      Then try to connect the database from NetBeans, it works for me.

    Good luck.

提交回复
热议问题