hdf5-java,如何在Windows Java项目和NetBeans中使用HDF5

I have a simple Java project and I have to write some data to a HDF5 file. I use Netbeans under Windows. Normally, I build libraries from the respective jar-files. So much for my knowledge how to do things ;)

I downloaded and installed the binaries from the hdf5 download page. But what comes next? I had a look at HDF5-Java support page but did not get any clue what to do to integrate HDF5 in my JavaApplication.

P.S.: I found sis-jhdf5 but I did not get it running as well. I also found some older sites explaining the compilation of HDF under windows and a thread for OS_X but that did not help me either.

There are so many different pages trying to explain this matter and I somehow lost the overview. May someone help me, please? A higher level of detail in the explanation would be appreciated ;)

解决方案

If you are not obliged to use a specific Java HDF5 library, you may want to have a look at HDFql which greatly simplify how HDF5 files are handled. This tool can be used in NetBeans IDE (8.2) as follows:

Download HDFql from http://www.hdfql.com/#download and unzip it.

Open NetBeans.

Select menu option File > New Project (a dialog titled New Project should pop-up).

Inside dialog New Project:

4.1. Select Java for the category and Java Application for the project.

4.2. Press button Next.

4.3. Specify a name for the project and its location.

4.4. Press button Finish.

Select menu option Run > Set Project Configuration > Customize (a dialog titled Project Properties - ... should pop-up).

Inside dialog Project Properties - ...:

6.1. On the left side of the dialog, select Sources for the category, and after:

6.1.1. Press button Add Folder... in the Source Packages Folders (a dialog titled Add Source Folder should pop-up):

6.1.1.1. Inside dialog Add Source Folder, select the folder where the HDFql Java wrapper was unzipped in step 1. Example: c:\hdfql-2.0.0\wrapper\java.

6.2. On the left side of the dialog, select Run for the category, and after:

6.2.1 On the VM Options field, insert -Djava.library.path=c:\hdfql-2.0.0\wrapper\java\as\hdfql.

The NetBeans project is now properly configured to use HDFql. Now, if you run the following Java program (as an example):

import as.hdfql.*;

public class Test

{

public static void main(String[] args)

{

// create an HDF5 file named "test.h5"

HDFql.execute("CREATE FILE test.h5");

}

}

An HDF5 file named test.h5 will be created in the folder where this program ran.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值