简体   繁体   English

Netbeans无法使用JDK 1.8.0_40启动Java DB Server

[英]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 那是我的设置: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,并且一切运行正常。 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. 卸载了JDK 1.8.0_31,安装了JDK 1.8.0_40,并调整了JAVA_HOME var以反映新的JDK版本,从C:\\ java \\ jdk1.8.0_31到C:\\ java \\ jdk1.8.0_40。

I applied the following changes to my Netbeans: 1) Menu Tools | 我对Netbeans进行了以下更改:1)菜单工具| 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. 库:已更改“ Java DB驱动程序”以反映JDK版本随附的库:C:\\ java \\ jdk1.8.0_40 \\ db \\ lib \\ derby.jar C:\\ java \\ jdk1.8.0_40 \\ db \\ lib \\ derbyLocale_pt_BR.jar(我来自巴西)C:\\ java \\ jdk1.8.0_40 \\ db \\ lib \\ derbyclient.jar C:\\ java \\ jdk1.8.0_40 \\ db \\ lib \\ derbynet.jar 2)“服务”标签,右键单击“ Java DB”的“属性”菜单项:a)将“ Java DB安装”设置为C:\\ java \\ jdk1.8.0_40 \\ db b)在一切正常的情况下,数据库位置相同。

In (1) the only difference is in the JDK root dir. 在(1)中,唯一的区别在于JDK根目录。

Now when I right-click on 'Java DB' on 'Services' tab nothing happens, no error, no messages, simply nothing. 现在,当我右键单击“服务”选项卡上的“ Java DB”时,什么也没有发生,没有错误,没有消息,只是什么也没有。

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. 如果我右键单击任何现有的Derby连接并选择“连接...”,则会在状态栏(位于Netbeans主窗口的底部)上显示一个小窗口,显示消息“正在连接至数据库,请稍候...”。 ),并显示一条消息“正在启动Java DB Server”,并且该进程将永远运行,因为什么也没发生。 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?". 我可以关闭小窗口,然后尝试关闭状态栏上的消息,出现另一个窗口,显示消息“您确定要取消启动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?" 我单击“是”按钮,然后单击另一个带有有线消息的窗口:“ Java DB服务器未在0秒内启动。您是否要再等待0秒?” shows up, I click "No" button and the process of starting Java DB Server seems to stop. 出现时,我单击“否”按钮,启动Java DB Server的过程似乎停止了。

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: 只需将Java提供的数据库更改为GlassFish提供的数据库即可:

  1. Make sure you have NetBeans installation with GlassFish (and JavaDB) 确保使用GlassFish(和JavaDB)安装了NetBeans。
  2. Open dialog NetBeans → ProjectManager → Services → Databases → JavaDB(right click) → Properties: 打开对话框NetBeans→ProjectManager→服务→数据库→JavaDB(右键单击)→属性:

    原始路径

  3. My screen is from Linux installation. 我的屏幕来自Linux安装。 You probably have something like C:\\java\\jdk1.8.0_40\\db as Java DB Installation. 您可能有类似C:\\ java \\ jdk1.8.0_40 \\ db之类的Java DB Installation。 . Change this path to the one from Glassfish. 将此路径更改为Glassfish中的路径。 I don't know where it is on Windows, here's mine path: 我不知道Windows上的位置,这是我的路径:

    更正的路径

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. 这只是解决方法,因为我不知道为什么Oracle提供的Java> = 1.8.0_40的JavaDB服务器在执行后立即退出。 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 我在Mac Os X 10.10.3NetBeans 8.0.2Oracle 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 . 运行$DERBY_HOME/bin/sysinfo (或$JAVA_HOME/db/bin/sysinfo ),我在/Library/Java/Extension上找到了derby库的先前版本。 I solved the problem removing this files. 我解决了删除此文件的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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