Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/343.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何在eclipse内部编辑器中打开excel文件_Java_Eclipse_Eclipse Plugin - Fatal编程技术网

Java 如何在eclipse内部编辑器中打开excel文件

Java 如何在eclipse内部编辑器中打开excel文件,java,eclipse,eclipse-plugin,Java,Eclipse,Eclipse Plugin,我需要在eclipse内部编辑器中从project explorer打开excel文件。我正在调用下面的函数在编辑器中打开文件 public static void openFileIntoEditor(String filePath) { File fileToOpen = new File(filePath); if (fileToOpen.exists() && fileToOpen.isFile()) { try {

我需要在eclipse内部编辑器中从project explorer打开excel文件。我正在调用下面的函数在编辑器中打开文件

public static void openFileIntoEditor(String filePath) {
    File fileToOpen = new File(filePath);
    if (fileToOpen.exists() && fileToOpen.isFile()) {
        try {
            IFileStore fileStore = EFS.getLocalFileSystem().getStore(fileToOpen.toURI());
            IWorkbenchPage page = GUIHandler.getPage();
            try {
                IDE.openInternalEditorOnFileStore(page, fileStore);
                //IDE.openEditorOnFileStore(page, fileStore);
            } catch (PartInitException e) {
                System.out.println("ERORR in openFileIntoEditor : " + e.getMessage());
            }
        } catch (Exception e) {
            System.out.println("ERORR in openFileIntoEditor2 : " + e.getMessage());
        }
    } else {
    }
}

它适用于文本文件,但当我试图在内部编辑器中打开excel文件时,会显示一些二进制代码。我哪里做错了,或者需要做什么才能通过java程序在内部Eclipse编辑器中打开excel文件

标准Eclipse中没有Excel文件的内部编辑器。因此,您只需要使用普通的文本编辑器来编辑二进制文件


您可以尝试
IDE.openeditoronflestore
,这可能会在Eclipse中打开“就地系统编辑器”(您需要在“常规>编辑器”页面的首选项中设置“允许就地系统编辑器”选项)。

标准Eclipse中没有Excel文件的内部编辑器。因此,您只需要使用普通的文本编辑器来编辑二进制文件


您可以尝试
IDE.openeditoronflestore
,这可能会在Eclipse中打开一个“就地系统编辑器”(您需要在“常规>编辑器”页面的首选项中设置“允许就地系统编辑器”选项)。

如果excel文件没有损坏,您可以双击它在编辑器中打开它。 要读取或写入excel文件,应使用ApachePOI框架


如果excel文件未损坏,您只需双击它即可在编辑器中打开它。 要读取或写入excel文件,应使用ApachePOI框架


我需要用java程序打开excel文件我需要用java程序打开excel文件