gpt4 book ai didi

java - 从命令行调用时使用处理 opengl 库缺少什么?

转载 作者:行者123 更新时间:2023-12-01 15:29:16 26 4
gpt4 key购买 nike

我从 here 中提取了一个草图:

import processing.opengl.*;

float a;

void setup() {
size(800, 600, OPENGL);
fill(0, 153);
noStroke();
}

void draw() {
background(255);
translate(width/2, height/2);
rotateX(a);
rotateY(a*2);
rect(-200, -200, 400, 400);
rotateX(PI/2);
rect(-200, -200, 400, 400);
a += 0.01;
}

当我从处理 IDE 运行此草图时,它工作正常。尝试从命令行运行它,情况不太如此:

$ /home/blt/projects/processing-1.2.1/java/bin/java -classpath "/home/blt/projects/processing-1.2.1/java/lib/rt.jar:/home/blt/projects/processing-1.2.1/java/lib/tools.jar:/home/blt/projects/processing-1.2.1/lib/antlr.jar:/home/blt/projects/processing-1.2.1/lib/core.jar:/home/blt/projects/processing-1.2.1/lib/ecj.jar:/home/blt/projects/processing-1.2.1/lib/jna.jar:/home/blt/projects/processing-1.2.1/lib/pde.jar:/home/blt/projects/processing-1.2.1/libraries/opengl/library/opengl.jar:/home/blt/projects/processing-1.2.1/libraries/opengl/library/jogl.jar:/home/blt/projects/processing-1.2.1/libraries/opengl/library/gluegen-rt.jar" processing.app.Commander --sketch="/home/blt/sketchbook/sketch_mar18a/" --output="/home/blt/sketchbook/sketch_mar18a/output" --run
Exception in thread "main" java.lang.NullPointerException
at processing.app.Sketch.preprocess(Sketch.java:1381)
at processing.app.Sketch.preprocess(Sketch.java:1205)
at processing.app.Sketch.build(Sketch.java:1568)
at processing.app.Commander.<init>(Commander.java:206)
at processing.app.Commander.main(Commander.java:97)

请注意,在类路径的末尾,我包含了 libraries/opengl/library/export.txt 中提到的所有 jar。我缺少什么?

最佳答案

关于java - 从命令行调用时使用处理 opengl 库缺少什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9760015/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com