问题
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.
回答1:
I have the same problem. I found a workaround. Just change db provided with Java to the one provided with GlassFish:
- Make sure you have NetBeans installation with GlassFish (and JavaDB)
Open dialog NetBeans → ProjectManager → Services → Databases → JavaDB(right click) → Properties:
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.
回答2:
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.
来源:https://stackoverflow.com/questions/29196489/netbeans-not-starting-java-db-server-with-jdk-1-8-0-40