Java和cmake:包不存在

时间:2018-01-26 01:20:11

标签: java cmake

我正在安装this tool(使用cmake)调用以下内容:

import tv.porst.swfretools.dissector.console.ConsoleDumper;

public class SWFExtractor {

    /**
    * @param args - command-line arguments; this program 
    *               requires the path to the SWF file to 
    *               be analyzed as its first argument
    */
    public static void main(String[] args) {
        ConsoleDumper.dump(args[0]);
    System.out.println("OKAY - DONE!");
    }

}

但是,它会返回错误,说明包不存在:

Screen capture of the error.

以下是相关JAR文件的内容:

JAR file contents.

这是CLASSPATH:

  

user @ ubuntu:〜$ echo $ CLASSPATH   :/home/user/swfretools_140/dissector.jar:/家庭/用户/ swfretools_140:/usr/local/include/dissector.jar

有什么建议吗?

1 个答案:

答案 0 :(得分:0)

我认为它看不到类路径。您可以尝试通过更改行来修改文件hidost/CMakeLists.txt

add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/SWFExtractor.class
COMMAND javac -d ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/SWFExtractor.java)

add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/SWFExtractor.class
COMMAND javac -d ${CMAKE_CURRENT_SOURCE_DIR} -cp $ENV{CLASSPATH} ${CMAKE_CURRENT_SOURCE_DIR}/SWFExtractor.java)

编辑: 我有一个拼写错误,将其更改为-d ${CMAKE_CURRENT_SOURCE_DIR} -cp $ENV{CLASSPATH}