문제

I have been attempting to install Clojure on Ubuntu using the directions found here:

http://riddell.us/ClojureOnUbuntu.html

For starters, that version of Java no longer seems to be supported- so I installed the Open JDK version 7 and have been attempting to use ant with that. Problem is, whenever I type sudo ant to begin the build in the Clojure folder, I get:

Unable to locate tools.jar. Expected to find it in /usr/lib/jvm/java-6-openjdk/lib/tools.jar
Buildfile: /home/nathan/opt/clojure/build.xml

And then eventually:

BUILD FAILED
/home/nathan/opt/clojure/build.xml:40: java.lang.UnsupportedClassVersionError: com/sun    
/tools/javac/Main : Unsupported major.minor version 51.0

Note that at first it would fail because it could not locate tools.jar, but then I copied tools.jar from the jvm directory where the most recent version was located to usr/share/ant/lib to try and make it work. Anyone have leads or advice how to get this to work?

Thank you kindly!

도움이 되었습니까?

해결책

My apologies for the lingering outdated documentation from
The bad old days before leiningen, and zi (clojure maven plugin)

Nobody* installs clojure anymore in the sense that you would install any other program, instead they install a standard java build tool (Maven2/3) and then use that tool to build their clojure programs. both leiningne and zi are built ontop of maven and you should choose between them. There is still some lingering traces of the days when people built Clojure code with Ant and if you come across one of these (and have no explicit reason to use And) ignore it and try lieningen or zi.

  • leiningen is more widely adopted and installs as a single .sh or .bat file you download
  • you get zi by adding it as a plugin in your projects pom.xml
  • another very popular clojure maven plugin is available here

다른 팁

For the most part, the Clojure material on riddell.us is insanely out of date and should be completely ignored and banished from all Clojure search results. With that in mind, if you'd just like to do some Clojure development on Ubuntu, simply install Leiningen, create a new project (lein new my-project) and start hacking. Generally, you never "install" Clojure on your system. It's used as a library of your project, which is handled by Leiningen.

On the other hand, if you actually want to hack on Clojure itself, follow the build instructions in the README on the Clojure github page.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top