How do I import jars into my java program?

前端 未结 13 1552
自闭症患者
自闭症患者 2021-01-04 12:52

I\'ve downloaded two jars. I want to import some of their contained classes. How do I do this?

It\'s for my algorithms class. I\'ve tried following the instructions

13条回答
  •  Happy的楠姐
    2021-01-04 13:42

    It is outdated to answer this question, but maybe it will be useful for future participants of Princeton Algorithms course. After adding CLASSPATH in environment java get classes from packages but still will generate errors on import command. You need to delete import algs4 and stdlib from source files and compilation will run smoothly.

    This solution works on Ubuntu 12.04 with zsh.

提交回复
热议问题