简体   繁体   中英

Netbeans not starting Java DB Server with JDK 1.8.0_40

That's my setup: 1) Windows 8.1 2) JDK 1.8.0_40 3) Netbenas 8.0.2

The system was running JDK 1.8.0_31 and everything was working pretty well. JDK 1.8.0_31 was uninstalled and JDK 1.8.0_40 installed and JAVA_HOME var was adjusted to reflect the new JDK version, from C:\\java\\jdk1.8.0_31 to C:\\java\\jdk1.8.0_40.

I applied the following changes to my Netbeans: 1) Menu Tools | Libraries: 'Java DB Driver' was changed to reflect the libraries which come with JDK version: C:\\java\\jdk1.8.0_40\\db\\lib\\derby.jar C:\\java\\jdk1.8.0_40\\db\\lib\\derbyLocale_pt_BR.jar (I'm from Brazil) C:\\java\\jdk1.8.0_40\\db\\lib\\derbyclient.jar C:\\java\\jdk1.8.0_40\\db\\lib\\derbynet.jar 2) 'Services' tab, right-click on 'Java DB', Properties menu item: a) 'Java DB Installation' setup to C:\\java\\jdk1.8.0_40\\db b) Database location is the same when everything was working fine.

In (1) the only difference is in the JDK root dir.

Now when I right-click on 'Java DB' on 'Services' tab nothing happens, no error, no messages, simply nothing.

If I right-click on any existing Derby connection and choose 'Connect...' a small windows shows up with the message "Connecting to database, please wait..." and in the status bar (on the botton of Netbeans main window) there's a message "Starting the Java DB Server" and that process stays running forever 'cause nothing happens. I can close the small window, then I try to close the message on status bar another windows shows up with the message "Are you sure you want to cancel Starting Java DB Server?". I click "Yes" button and another window with a wired message "The Java DB server did not start in 0 seconds. Do you want to wait another 0 seconds?" shows up, I click "No" button and the process of starting Java DB Server seems to stop.

I appreciate any contributions to get that wired problem solved.

I have the same problem. I found a workaround. Just change db provided with Java to the one provided with GlassFish:

  1. Make sure you have NetBeans installation with GlassFish (and JavaDB)
  2. Open dialog NetBeans → ProjectManager → Services → Databases → JavaDB(right click) → Properties:

    原始路径

  3. My screen is from Linux installation. You probably have something like C:\\java\\jdk1.8.0_40\\db as Java DB Installation. . Change this path to the one from Glassfish. I don't know where it is on Windows, here's mine path:

    更正的路径

This is only workaround, as I don't know why JavaDB server provided by Oracle with Java >= 1.8.0_40 exits immediate after execution. Probably this is some kind of bug.

I had the same problem on Mac Os X 10.10.3 , NetBeans 8.0.2 , Oracle JDK 8.0.45

Running $DERBY_HOME/bin/sysinfo (or $JAVA_HOME/db/bin/sysinfo ), I found a previous version of derby library on /Library/Java/Extension . I solved the problem removing this files.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM