如何在Windows Java项目和NetBeans中使用HDF5 [英] How to use HDF5 in Windows Java project with NetBeans

查看:177
本文介绍了如何在Windows Java项目和NetBeans中使用HDF5的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的Java项目,必须将一些数据写入HDF5文件.我在Windows下使用Netbeans.通常,我从相应的jar文件构建库.就我所知如何做事而言,是如此之多;)

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 ;)

我从 hdf5下载页面下载并安装了二进制文件.但是接下来呢?我看了 HDF5-Java支持页面,但没有任何线索如何将HDF5集成到我的JavaApplication中.

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.

PS:我找到了 sis-jhdf5 ,但我没有找到使其运行良好.我还找到了一些较旧的网站,这些网站解释了 OS_X 的线程但这也无济于事.

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 ;)

推荐答案

如果您没有义务使用特定的Java HDF5库,则可能需要看看

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:

  1. http://www.hdfql.com/#download 下载HDFql并解压缩.

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

打开NetBeans.

Open NetBeans.

选择菜单选项File > New Project(应弹出一个标题为New Project的对话框).

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

内部对话框New Project:

4.1.选择Java作为类别,选择Java Application作为项目.

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

4.2.按下Next按钮.

4.3.指定项目的名称及其位置.

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

4.4.按下按钮Finish.

选择菜单选项Run > Set Project Configuration > Customize(应弹出一个标题为Project Properties - ...的对话框).

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

内部对话框Project Properties - ...:

6.1.在对话框的左侧,选择Sources作为类别,然后选择:

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

6.1.1.按下Source Packages Folders中的Add Folder...按钮(应弹出一个标题为Add Source Folder的对话框):

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.在对话框Add Source Folder中,选择在步骤1中解压缩了HDFql Java包装器的文件夹.示例:c:\hdfql-2.0.0\wrapper\java.

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.在对话框的左侧,选择Run作为类别,然后选择:

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

6.2.1在VM Options字段上,插入-Djava.library.path=c:\hdfql-2.0.0\wrapper\java\as\hdfql.

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

现在已正确配置NetBeans项目以使用HDFql.现在,如果您运行以下Java程序(作为示例):

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");
    }
}

将在运行该程序的文件夹中创建一个名为test.h5的HDF5文件.

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

这篇关于如何在Windows Java项目和NetBeans中使用HDF5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆