Cannot compile when importing Processing library into eclipse

前端 未结 3 1624
野趣味
野趣味 2021-01-24 17:29

I am trying to build a program using the Processing library in eclipse. The process should be relatively straightforward but I cannot compile even an empty processing program. I

相关标签:
3条回答
  • 2021-01-24 17:44

    I had the exact same problem after upgrading to JDK 9. I reported it as an issue here (https://github.com/processing/processing/issues/5371), and received confirmation that Processing 3 is incompatible with v9. For now, the only workaround is to downgrade to v8.

    0 讨论(0)
  • 2021-01-24 18:02

    I cannot compile even an empty processing program.

    This is not a compiler error. This is a runtime error.

    Anyway, like chrylis mentioned, this is because your classpath is not correct. How you fix this depends on which IDE you're using, but in eclipse you would right-click your project, then click properties, then go to the Java Build Path section on the left. Then go to the Libraries tab and add the Processing jars.

    My guess is that you've added core.jar, which is all you need to compile your code. But since you're running on a Mac, you need the Mac-specific jars as well. You'll have to look in your Processing installation directory. Sorry I can't be more specific, but I don't have a Mac.

    0 讨论(0)
  • 2021-01-24 18:05

    I had the exact same problem on my Mac with eclipse projects. But processing app was compiling fine by itself. So I looked up in processing app contents and found the jdk it uses (located in Processing/Contents/Plugins/ ) So I used it as my jdk with my project and it worked!

    (I also installed the required libs (opengl ones) specified in core.jar contents (opened with Keka))

    0 讨论(0)
提交回复
热议问题