如何将CodenameOne源附加到我的项目?

时间:2017-02-09 15:46:34

标签: codenameone

我想潜入CN1集市。我跟git一起关注了thisthis tutorial。但是在NetBeans中,当我按住CN1对象时,它会显示“显示生成的源文件。没有源附加到类'JAR文件。”。如果我附上我刚刚下载的来源,即“CodenameOne / CodenameOne / src”,那些来源仍然没有发现!

我尝试清理并构建项目但出现了错误:

Building jar: /home/pathTo/CodenameOneSRC/CodenameOne/CodenameOne/dist/CodenameOne.jar
CodenameOne.jar:
JavaSE.init:
JavaSE.deps-jar:
Created dir: /home/pathTo/CodenameOneSRC/CodenameOne/Ports/JavaSE/build
Updating property file: /home/pathTo/myProject/build/built-jar.properties
Created dir:     /home/pathTo/CodenameOneSRC/CodenameOne/Ports/JavaSE/build/classes
Created dir: /home/pathTo/CodenameOneSRC/CodenameOne/Ports/JavaSE/build/empty
Created dir: /home/pathTo/CodenameOneSRC/CodenameOne/Ports/JavaSE/build/generated-sources/ap-source-output
Compiling 21 source files to /home/pathTo/CodenameOneSRC/CodenameOne/Ports/JavaSE/build/classes
warning: [options] bootstrap class path not set in conjunction with -source 1.7
/home/pathTo/CodenameOneSRC/CodenameOne/Ports/JavaSE/src/com/codename1/impl/javase/JavaSEPort.java:115: error: package com.jhlabs.image does not exist
import com.jhlabs.image.GaussianFilter;
/home/pathTo/CodenameOneSRC/CodenameOne/Ports/JavaSE/src/com/codename1/impl/javase/JavaSEPort.java:8757: error: cannot find symbol
    GaussianFilter gf = new GaussianFilter(radius);
symbol:   class GaussianFilter
location: class JavaSEPort
    /home/pathTo/CodenameOneSRC/CodenameOne/Ports/JavaSE/src/com/codename1/impl/javase/JavaSEPort.java:8757: error: cannot find symbol
    GaussianFilter gf = new GaussianFilter(radius);
symbol:   class GaussianFilter    location: class JavaSEPort
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
3 errors
1 warning
/home/pathTo/myProject/nbproject/build-impl.xml:914: The following error occurred while executing this line:
/home/pathTo/myProject/nbproject/build-impl.xml:1445: The following error occurred while executing this line:
/home/pathTo/CodenameOneSRC/CodenameOne/Ports/JavaSE/nbproject/build-impl.xml:937: The following error occurred while executing this line:
/home/pathTo/CodenameOneSRC/CodenameOne/Ports/JavaSE/nbproject/build-impl.xml:269: Compile failed; see the compiler error output for details.
BUILD FAILED (total time: 14 seconds)

此外,项目无法再运行,因为找不到主类(虽然我在运行部分添加了ports / JavaSE.jar)。

如何正确附加源并更改CN1源代码?

任何帮助表示赞赏,

问候

1 个答案:

答案 0 :(得分:0)

您需要cn1-binaries项目,并且需要确保JavaSE项目中的路径指向该项目中的有效位置。

E.g。 GaussianFilterFilters.jar内定义,位于该项目中。