Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
FS#21091 - [clojure] cannot start shell using sudo (sudo clj)
Attached to Project:
Community Packages
Opened by Sergey (Prikrutil) - Tuesday, 05 October 2010, 18:02 GMT
Last edited by Thomas Dziedzic (tomd123) - Thursday, 07 October 2010, 22:26 GMT
Opened by Sergey (Prikrutil) - Tuesday, 05 October 2010, 18:02 GMT
Last edited by Thomas Dziedzic (tomd123) - Thursday, 07 October 2010, 22:26 GMT
|
DetailsDescription:
When I'm trying to start clojure shell using "sudo" I see the following error in console: [sergey@myhost setup]$ sudo clj Exception in thread "main" java.lang.NoClassDefFoundError: clojure/main Caused by: java.lang.ClassNotFoundException: clojure.main at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) Could not find the main class: clojure.main. Program will exit. "sudo scala" works fine. Also it isn't possible to run clojure script with root privileges by issuing "sudo script.clj" for the same reason. Additional info: * package version(s) clojure 1.2.0-2 jdk 6u21-1 |
This task depends upon
Closed by Thomas Dziedzic (tomd123)
Thursday, 07 October 2010, 22:26 GMT
Reason for closing: Fixed
Additional comments about closing: fixed in -3
Thursday, 07 October 2010, 22:26 GMT
Reason for closing: Fixed
Additional comments about closing: fixed in -3
I'm not exactly sure how to attack this because it does work under su, since it sources the clojure.sh file.
CLOJURE_HOME=/usr/share/clojure
at the beginning of the /usr/bin/clj fixes the problem. Do we really need to have CLOJURE_HOME defined in /etc/profile.d/clojure.sh? It may be used by some PKGBUILDs
Also there is a ticket "Multiplatform command-line clojure launcher" in Clojure's bug-tracker: http://www.assembla.com/spaces/clojure/tickets/366-multiplatform-command-line-clojure-launcher
#####################################
#!/bin/sh
# If $CLOJURE_HOME isn't defined take it from clojure.sh
if [ ! "$CLOJURE_HOME" ]; then
. /etc/profile.d/clojure.sh
fi
#####################################
[1] "Let's respect CLOJURE_HOME"
http://groups.google.com/group/clojure/browse_thread/thread/b0745c73579bac6c/38a4b76320805b32?lnk=gst&q=clojure_home#38a4b76320805b32