This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Unable to install scala on the Mac

15 replies
ilango_g
Joined: 2009-07-15,
User offline. Last seen 42 years 45 weeks ago.

I am trying to install Scala on Mac OS Leopard. I ran the Scala Installer jar
in /usr/local/share. Unfortunately I cannot run Scala, and I keep getting
the message "-bash: scala: command not found

If anybody has hints for me, I would appreciate it. Thanks in advance for
your time.

Viktor Klang
Joined: 2008-12-17,
User offline. Last seen 1 year 27 weeks ago.
Re: Unable to install scala on the Mac
Add the $SCALA_HOME/bin to your PATH in ~/.bash_profile

On Fri, Aug 28, 2009 at 9:39 PM, ilango_g <ilangocal@yahoo.com> wrote:

I am trying to install Scala on Mac OS Leopard. I ran the Scala Installer jar
in /usr/local/share. Unfortunately I cannot run Scala, and I keep getting
the message "-bash: scala: command not found

If anybody has hints for me, I would appreciate it. Thanks in advance for
your time.
--
View this message in context: http://www.nabble.com/Unable-to-install-scala-on-the-Mac-tp25195790p25195790.html
Sent from the Scala mailing list archive at Nabble.com.




--
Viktor Klang

Blog: klangism.blogspot.com
Twttr: viktorklang

Lift Committer - liftweb.com
AKKA Committer - akkasource.org
Cassidy - github.com/viktorklang/Cassidy.git
SoftPub founder: http://groups.google.com/group/softpub
OnorioCatenacci
Joined: 2009-04-15,
User offline. Last seen 2 years 22 weeks ago.
Re: Unable to install scala on the Mac

On Fri, Aug 28, 2009 at 3:39 PM, ilango_g <ilangocal@yahoo.com> wrote:

I am trying to install Scala on Mac OS Leopard. I ran the Scala Installer jar
in /usr/local/share. Unfortunately I cannot run Scala, and I keep getting
the message "-bash: scala: command not found

If anybody has hints for me, I would appreciate it. Thanks in advance for
your time.

You might also wish to check this out:

http://www.macports.org/

They have a Scala port and this makes installation pretty simple.



--
Onorio

It is the greatest of all mistakes to do nothing because you can only do a little. -Sydney Smith, writer and clergyman (1771-1845)

ilango_g
Joined: 2009-07-15,
User offline. Last seen 42 years 45 weeks ago.
Re: Unable to install scala on the Mac

I will try that.

Viktor Klang wrote:
>
> Add the $SCALA_HOME/bin to your PATH in ~/.bash_profile
>
> On Fri, Aug 28, 2009 at 9:39 PM, ilango_g wrote:
>
>>
>> I am trying to install Scala on Mac OS Leopard. I ran the Scala Installer
>> jar
>> in /usr/local/share. Unfortunately I cannot run Scala, and I keep getting
>> the message "-bash: scala: command not found
>>
>> If anybody has hints for me, I would appreciate it. Thanks in advance for
>> your time.
>> --
>> View this message in context:
>> http://www.nabble.com/Unable-to-install-scala-on-the-Mac-tp25195790p2519...
>> Sent from the Scala mailing list archive at Nabble.com.
>>
>>
>
>

ilango_g
Joined: 2009-07-15,
User offline. Last seen 42 years 45 weeks ago.
Re: Unable to install scala on the Mac

I put it in .profle instead because that is where I put my JAVA_HOME and this
time when I typed in scala
this is what happened:

samantha-s-imac:bin Samantha$ scala
/usr/local/share/scala-2.7.5.final/bin/scala: line 12: uname: command not
found
/usr/local/share/scala-2.7.5.final/bin/scala: line 18: basename: command not
found
/usr/local/share/scala-2.7.5.final/bin/scala: line 29: dirname: command not
found
/usr/local/share/scala-2.7.5.final/bin/scala: line 47: ls: command not found
Exception in thread "main" java.lang.NoClassDefFoundError:
scala/tools/nsc/MainGenericRunner
Caused by: java.lang.ClassNotFoundException:
scala.tools.nsc.MainGenericRunner
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:319)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330)
at java.lang.ClassLoader.loadClass(ClassLoader.java:254)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:402)
samantha-s-imac:bin Samantha$

-ilango

Viktor Klang wrote:
>
> Add the $SCALA_HOME/bin to your PATH in ~/.bash_profile
>
> On Fri, Aug 28, 2009 at 9:39 PM, ilango_g wrote:
>
>>
>> I am trying to install Scala on Mac OS Leopard. I ran the Scala Installer
>> jar
>> in /usr/local/share. Unfortunately I cannot run Scala, and I keep getting
>> the message "-bash: scala: command not found
>>
>> If anybody has hints for me, I would appreciate it. Thanks in advance for
>> your time.
>> --
>> View this message in context:
>> http://www.nabble.com/Unable-to-install-scala-on-the-Mac-tp25195790p2519...
>> Sent from the Scala mailing list archive at Nabble.com.
>>
>>
>
>

David Flemström
Joined: 2009-08-10,
User offline. Last seen 42 years 45 weeks ago.
Re: Unable to install scala on the Mac
p, li { white-space: pre-wrap; }Woah... Are you running Scala in a chroot or something? Or have you accidentally deleted all of the standard UNIX tools? Because those errors are really severe.


My guess is that you've changed your whole PATH instead of appending to it. Please try:
export PATH=$SCALA_HOME/bin:$PATH


instead of:
export PATH=$SCALA_HOME/bin


...which is what you probably did.


On Sunday 30 August 2009 18:53:01 ilango_g wrote:
> I put it in .profle instead because that is where I put my JAVA_HOME and
> this time when I typed in scala
> this is what happened:
>
> samantha-s-imac:bin Samantha$ scala
> /usr/local/share/scala-2.7.5.final/bin/scala: line 12: uname: command not
> found
> /usr/local/share/scala-2.7.5.final/bin/scala: line 18: basename: command
> not found
> /usr/local/share/scala-2.7.5.final/bin/scala: line 29: dirname: command not
> found
> /usr/local/share/scala-2.7.5.final/bin/scala: line 47: ls: command not
> found Exception in thread "main" java.lang.NoClassDefFoundError:
> scala/tools/nsc/MainGenericRunner
> Caused by: java.lang.ClassNotFoundException:
> scala.tools.nsc.MainGenericRunner
> at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:319)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:254)
> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:402)
> samantha-s-imac:bin Samantha$
>
> -ilango
>
> Viktor Klang wrote:
> > Add the $SCALA_HOME/bin to your PATH in ~/.bash_profile
> >
> > On Fri, Aug 28, 2009 at 9:39 PM, ilango_g <ilangocal@yahoo.com> wrote:
> >> I am trying to install Scala on Mac OS Leopard. I ran the Scala
> >> Installer jar
> >> in /usr/local/share. Unfortunately I cannot run Scala, and I keep
> >> getting the message "-bash: scala: command not found
> >>
> >> If anybody has hints for me, I would appreciate it. Thanks in advance
> >> for your time.
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Unable-to-install-scala-on-the-Mac-tp25195790p2519
> >>5790.html Sent from the Scala mailing list archive at Nabble.com.


David Flemström
david.flemstrom@gmail.com
ilango_g
Joined: 2009-07-15,
User offline. Last seen 42 years 45 weeks ago.
Re: Unable to install scala on the Mac

It looks like I accidentally deleted all of the standard Unix tools.
When I say "which sudo"
it says" -bash: which: command not found.
if I say "sudo pico .profile
it says" -bash: sudo: command not found

But I cannot understand how I did that. What do you suggest I do about the
situation?

David Flemström wrote:
>
> Woah... Are you running Scala in a chroot or something? Or have you
> accidentally deleted all of the standard UNIX tools? Because those errors
> are
> really severe.
>
> My guess is that you've changed your whole PATH instead of appending to
> it.
> Please try:
> export PATH=$SCALA_HOME/bin:$PATH
>
> instead of:
> export PATH=$SCALA_HOME/bin
>
> ...which is what you probably did.
>
> On Sunday 30 August 2009 18:53:01 ilango_g wrote:
>> I put it in .profle instead because that is where I put my JAVA_HOME and
>> this time when I typed in scala
>> this is what happened:
>>
>> samantha-s-imac:bin Samantha$ scala
>> /usr/local/share/scala-2.7.5.final/bin/scala: line 12: uname: command not
>> found
>> /usr/local/share/scala-2.7.5.final/bin/scala: line 18: basename: command
>> not found
>> /usr/local/share/scala-2.7.5.final/bin/scala: line 29: dirname: command
>> not
>> found
>> /usr/local/share/scala-2.7.5.final/bin/scala: line 47: ls: command not
>> found Exception in thread "main" java.lang.NoClassDefFoundError:
>> scala/tools/nsc/MainGenericRunner
>> Caused by: java.lang.ClassNotFoundException:
>> scala.tools.nsc.MainGenericRunner
>> at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
>> at java.security.AccessController.doPrivileged(Native Method)
>> at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>> at java.lang.ClassLoader.loadClass(ClassLoader.java:319)
>> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330)
>> at java.lang.ClassLoader.loadClass(ClassLoader.java:254)
>> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:402)
>> samantha-s-imac:bin Samantha$
>>
>> -ilango
>>
>> Viktor Klang wrote:
>> > Add the $SCALA_HOME/bin to your PATH in ~/.bash_profile
>> >
>> > On Fri, Aug 28, 2009 at 9:39 PM, ilango_g wrote:
>> >> I am trying to install Scala on Mac OS Leopard. I ran the Scala
>> >> Installer jar
>> >> in /usr/local/share. Unfortunately I cannot run Scala, and I keep
>> >> getting the message "-bash: scala: command not found
>> >>
>> >> If anybody has hints for me, I would appreciate it. Thanks in advance
>> >> for your time.
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/Unable-to-install-scala-on-the-Mac-tp25195790p2519
>> >>5790.html Sent from the Scala mailing list archive at Nabble.com.
>
>
> David Flemström
> david.flemstrom@gmail.com
>
>

Randall R Schulz
Joined: 2008-12-16,
User offline. Last seen 1 year 29 weeks ago.
Re: Unable to install scala on the Mac

On Sunday August 30 2009, ilango_g wrote:
> It looks like I accidentally deleted all of the standard Unix tools.
> When I say "which sudo"
> it says" -bash: which: command not found.
> if I say "sudo pico .profile
> it says" -bash: sudo: command not found
>
> But I cannot understand how I did that. What do you suggest I do
> about the situation?

It's probably more likely that your PATH variable is messed up (or even
empty). Check that.

Randall Schulz

David Flemström
Joined: 2009-08-10,
User offline. Last seen 42 years 45 weeks ago.
Re: Unable to install scala on the Mac
p, li { white-space: pre-wrap; }I'll say it again: Your PATH is destroyed, but your tools are still there. On Linux, I would do:
export PATH=/usr/bin:/bin
...but I think that the UNIX executables are stored elsewhere on a Mac.


To be absolutely certain that everything is available, type:
export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin


That fixes your PATH temporarily (so that you regain some basic paths) and then you can edit your .profile to what I posted before. A relogin should fix everything after that.


On Sunday 30 August 2009 20:43:09 ilango_g wrote:
> It looks like I accidentally deleted all of the standard Unix tools.
> When I say "which sudo"
> it says" -bash: which: command not found.
> if I say "sudo pico .profile
> it says" -bash: sudo: command not found
>
> But I cannot understand how I did that. What do you suggest I do about the
> situation?
>
> David Flemström wrote:
> > Woah... Are you running Scala in a chroot or something? Or have you
> > accidentally deleted all of the standard UNIX tools? Because those errors
> > are
> > really severe.
> >
> > My guess is that you've changed your whole PATH instead of appending to
> > it.
> > Please try:
> > export PATH=$SCALA_HOME/bin:$PATH
> >
> > instead of:
> > export PATH=$SCALA_HOME/bin
> >
> > ...which is what you probably did.
> >
> > On Sunday 30 August 2009 18:53:01 ilango_g wrote:
> >> I put it in .profle instead because that is where I put my JAVA_HOME and
> >> this time when I typed in scala
> >> this is what happened:
> >>
> >> samantha-s-imac:bin Samantha$ scala
> >> /usr/local/share/scala-2.7.5.final/bin/scala: line 12: uname: command
> >> not found
> >> /usr/local/share/scala-2.7.5.final/bin/scala: line 18: basename: command
> >> not found
> >> /usr/local/share/scala-2.7.5.final/bin/scala: line 29: dirname: command
> >> not
> >> found
> >> /usr/local/share/scala-2.7.5.final/bin/scala: line 47: ls: command not
> >> found Exception in thread "main" java.lang.NoClassDefFoundError:
> >> scala/tools/nsc/MainGenericRunner
> >> Caused by: java.lang.ClassNotFoundException:
> >> scala.tools.nsc.MainGenericRunner
> >> at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
> >> at java.security.AccessController.doPrivileged(Native Method)
> >> at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
> >> at java.lang.ClassLoader.loadClass(ClassLoader.java:319)
> >> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330)
> >> at java.lang.ClassLoader.loadClass(ClassLoader.java:254)
> >> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:402)
> >> samantha-s-imac:bin Samantha$
> >>
> >> -ilango
> >>
> >> Viktor Klang wrote:
> >> > Add the $SCALA_HOME/bin to your PATH in ~/.bash_profile
> >> >
> >> > On Fri, Aug 28, 2009 at 9:39 PM, ilango_g <ilangocal@yahoo.com> wrote:
> >> >> I am trying to install Scala on Mac OS Leopard. I ran the Scala
> >> >> Installer jar
> >> >> in /usr/local/share. Unfortunately I cannot run Scala, and I keep
> >> >> getting the message "-bash: scala: command not found
> >> >>
> >> >> If anybody has hints for me, I would appreciate it. Thanks in advance
> >> >> for your time.
> >> >> --
> >> >> View this message in context:
> >>
> >> http://www.nabble.com/Unable-to-install-scala-on-the-Mac-tp25195790p2519
> >>
> >> >>5790.html Sent from the Scala mailing list archive at Nabble.com.
> >
> > David Flemström
> > david.flemstrom@gmail.com


David Flemström
david.flemstrom@gmail.com
David Flemström
Joined: 2009-08-10,
User offline. Last seen 42 years 45 weeks ago.
Re: Unable to install scala on the Mac
p, li { white-space: pre-wrap; }Oh and BTW, don't use sudo when you want to edit your .profile file. You own the file yourself, so you don't need any extra privileges that sudo gives you.


nano .profile
or
pico .profile
or
vim .profile
...is enough.


On Sunday 30 August 2009 20:57:37 you wrote:
> I'll say it again: Your PATH is destroyed, but your tools are still there.
> On Linux, I would do:
> export PATH=/usr/bin:/bin
> ...but I think that the UNIX executables are stored elsewhere on a Mac.
>
> To be absolutely certain that everything is available, type:
> export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
>
> That fixes your PATH temporarily (so that you regain some basic paths) and
> then you can edit your .profile to what I posted before. A relogin should
> fix everything after that.
>
> On Sunday 30 August 2009 20:43:09 ilango_g wrote:
> > It looks like I accidentally deleted all of the standard Unix tools.
> > When I say "which sudo"
> > it says" -bash: which: command not found.
> > if I say "sudo pico .profile
> > it says" -bash: sudo: command not found
> >
> > But I cannot understand how I did that. What do you suggest I do about
> > the situation?
> >
> > David Flemström wrote:
> > > Woah... Are you running Scala in a chroot or something? Or have you
> > > accidentally deleted all of the standard UNIX tools? Because those
> > > errors are
> > > really severe.
> > >
> > > My guess is that you've changed your whole PATH instead of appending to
> > > it.
> > > Please try:
> > > export PATH=$SCALA_HOME/bin:$PATH
> > >
> > > instead of:
> > > export PATH=$SCALA_HOME/bin
> > >
> > > ...which is what you probably did.
> > >
> > > On Sunday 30 August 2009 18:53:01 ilango_g wrote:
> > >> I put it in .profle instead because that is where I put my JAVA_HOME
> > >> and this time when I typed in scala
> > >> this is what happened:
> > >>
> > >> samantha-s-imac:bin Samantha$ scala
> > >> /usr/local/share/scala-2.7.5.final/bin/scala: line 12: uname: command
> > >> not found
> > >> /usr/local/share/scala-2.7.5.final/bin/scala: line 18: basename:
> > >> command not found
> > >> /usr/local/share/scala-2.7.5.final/bin/scala: line 29: dirname:
> > >> command not
> > >> found
> > >> /usr/local/share/scala-2.7.5.final/bin/scala: line 47: ls: command not
> > >> found Exception in thread "main" java.lang.NoClassDefFoundError:
> > >> scala/tools/nsc/MainGenericRunner
> > >> Caused by: java.lang.ClassNotFoundException:
> > >> scala.tools.nsc.MainGenericRunner
> > >> at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
> > >> at java.security.AccessController.doPrivileged(Native Method)
> > >> at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
> > >> at java.lang.ClassLoader.loadClass(ClassLoader.java:319)
> > >> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330)
> > >> at java.lang.ClassLoader.loadClass(ClassLoader.java:254)
> > >> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:402)
> > >> samantha-s-imac:bin Samantha$
> > >>
> > >> -ilango
> > >>
> > >> Viktor Klang wrote:
> > >> > Add the $SCALA_HOME/bin to your PATH in ~/.bash_profile
> > >> >
> > >> > On Fri, Aug 28, 2009 at 9:39 PM, ilango_g <ilangocal@yahoo.com> wrote:
> > >> >> I am trying to install Scala on Mac OS Leopard. I ran the Scala
> > >> >> Installer jar
> > >> >> in /usr/local/share. Unfortunately I cannot run Scala, and I keep
> > >> >> getting the message "-bash: scala: command not found
> > >> >>
> > >> >> If anybody has hints for me, I would appreciate it. Thanks in
> > >> >> advance for your time.
> > >> >> --
> > >> >> View this message in context:
> > >>
> > >> http://www.nabble.com/Unable-to-install-scala-on-the-Mac-tp25195790p25
> > >>19
> > >>
> > >> >>5790.html Sent from the Scala mailing list archive at Nabble.com.
> > >
> > > David Flemström
> > > david.flemstrom@gmail.com
>
> David Flemström
> david.flemstrom@gmail.com


David Flemström
david.flemstrom@gmail.com
Erik Engbrecht
Joined: 2008-12-19,
User offline. Last seen 3 years 18 weeks ago.
Re: Unable to install scala on the Mac
Actually I bet you just messed up your path...
type: echo $PATH
and see if it has anything on it.
Mine looks like this:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/git/bin
The stuff in "opt" is for MacPorts.

On Sun, Aug 30, 2009 at 2:43 PM, ilango_g <ilangocal@yahoo.com> wrote:

It looks like I accidentally deleted all of the standard Unix tools.
When I say "which sudo"
it says" -bash: which: command not found.
if I say "sudo pico .profile
it says" -bash: sudo: command not found

But I cannot understand how I did that.  What do you suggest I do about the
situation?

David Flemström wrote:
>
> Woah... Are you running Scala in a chroot or something? Or have you
> accidentally deleted all of the standard UNIX tools? Because those errors
> are
> really severe.
>
> My guess is that you've changed your whole PATH instead of appending to
> it.
> Please try:
> export PATH=$SCALA_HOME/bin:$PATH
>
> instead of:
> export PATH=$SCALA_HOME/bin
>
> ...which is what you probably did.
>
> On Sunday 30 August 2009 18:53:01 ilango_g wrote:
>> I put it in .profle instead because that is where I put my JAVA_HOME and
>> this time when I typed in scala
>> this is what happened:
>>
>> samantha-s-imac:bin Samantha$ scala
>> /usr/local/share/scala-2.7.5.final/bin/scala: line 12: uname: command not
>> found
>> /usr/local/share/scala-2.7.5.final/bin/scala: line 18: basename: command
>> not found
>> /usr/local/share/scala-2.7.5.final/bin/scala: line 29: dirname: command
>> not
>> found
>> /usr/local/share/scala-2.7.5.final/bin/scala: line 47: ls: command not
>> found Exception in thread "main" java.lang.NoClassDefFoundError:
>> scala/tools/nsc/MainGenericRunner
>> Caused by: java.lang.ClassNotFoundException:
>> scala.tools.nsc.MainGenericRunner
>>     at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
>>     at java.security.AccessController.doPrivileged(Native Method)
>>     at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>>     at java.lang.ClassLoader.loadClass(ClassLoader.java:319)
>>     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330)
>>     at java.lang.ClassLoader.loadClass(ClassLoader.java:254)
>>     at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:402)
>> samantha-s-imac:bin Samantha$
>>
>> -ilango
>>
>> Viktor Klang wrote:
>> > Add the $SCALA_HOME/bin to your PATH in ~/.bash_profile
>> >
>> > On Fri, Aug 28, 2009 at 9:39 PM, ilango_g <ilangocal@yahoo.com> wrote:
>> >> I am trying to install Scala on Mac OS Leopard. I ran the Scala
>> >> Installer jar
>> >> in /usr/local/share. Unfortunately I cannot run Scala, and I keep
>> >> getting the message "-bash: scala: command not found
>> >>
>> >> If anybody has hints for me, I would appreciate it. Thanks in advance
>> >> for your time.
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/Unable-to-install-scala-on-the-Mac-tp25195790p2519
>> >>5790.html Sent from the Scala mailing list archive at Nabble.com.
>
>
> David Flemström
> david.flemstrom@gmail.com
>
>

--
View this message in context: http://www.nabble.com/Unable-to-install-scala-on-the-Mac-tp25195790p25214404.html
Sent from the Scala mailing list archive at Nabble.com.




--
http://erikengbrecht.blogspot.com/
ilango_g
Joined: 2009-07-15,
User offline. Last seen 42 years 45 weeks ago.
Re: Unable to install scala on the Mac

I type in echo $PATH and it returned:
/usr/local/share/scala-2.7.5.final/bin

Erik Engbrecht wrote:
>
> Actually I bet you just messed up your path...
> type: echo $PATH
>
> and see if it has anything on it.
>
> Mine looks like this:
> /opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/git/bin
>
> The stuff in "opt" is for MacPorts.
>
> On Sun, Aug 30, 2009 at 2:43 PM, ilango_g wrote:
>
>>
>> It looks like I accidentally deleted all of the standard Unix tools.
>> When I say "which sudo"
>> it says" -bash: which: command not found.
>> if I say "sudo pico .profile
>> it says" -bash: sudo: command not found
>>
>> But I cannot understand how I did that. What do you suggest I do about
>> the
>> situation?
>>
>> David Flemström wrote:
>> >
>> > Woah... Are you running Scala in a chroot or something? Or have you
>> > accidentally deleted all of the standard UNIX tools? Because those
>> errors
>> > are
>> > really severe.
>> >
>> > My guess is that you've changed your whole PATH instead of appending to
>> > it.
>> > Please try:
>> > export PATH=$SCALA_HOME/bin:$PATH
>> >
>> > instead of:
>> > export PATH=$SCALA_HOME/bin
>> >
>> > ...which is what you probably did.
>> >
>> > On Sunday 30 August 2009 18:53:01 ilango_g wrote:
>> >> I put it in .profle instead because that is where I put my JAVA_HOME
>> and
>> >> this time when I typed in scala
>> >> this is what happened:
>> >>
>> >> samantha-s-imac:bin Samantha$ scala
>> >> /usr/local/share/scala-2.7.5.final/bin/scala: line 12: uname: command
>> not
>> >> found
>> >> /usr/local/share/scala-2.7.5.final/bin/scala: line 18: basename:
>> command
>> >> not found
>> >> /usr/local/share/scala-2.7.5.final/bin/scala: line 29: dirname:
>> command
>> >> not
>> >> found
>> >> /usr/local/share/scala-2.7.5.final/bin/scala: line 47: ls: command not
>> >> found Exception in thread "main" java.lang.NoClassDefFoundError:
>> >> scala/tools/nsc/MainGenericRunner
>> >> Caused by: java.lang.ClassNotFoundException:
>> >> scala.tools.nsc.MainGenericRunner
>> >> at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
>> >> at java.security.AccessController.doPrivileged(Native Method)
>> >> at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>> >> at java.lang.ClassLoader.loadClass(ClassLoader.java:319)
>> >> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330)
>> >> at java.lang.ClassLoader.loadClass(ClassLoader.java:254)
>> >> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:402)
>> >> samantha-s-imac:bin Samantha$
>> >>
>> >> -ilango
>> >>
>> >> Viktor Klang wrote:
>> >> > Add the $SCALA_HOME/bin to your PATH in ~/.bash_profile
>> >> >
>> >> > On Fri, Aug 28, 2009 at 9:39 PM, ilango_g
>> wrote:
>> >> >> I am trying to install Scala on Mac OS Leopard. I ran the Scala
>> >> >> Installer jar
>> >> >> in /usr/local/share. Unfortunately I cannot run Scala, and I keep
>> >> >> getting the message "-bash: scala: command not found
>> >> >>
>> >> >> If anybody has hints for me, I would appreciate it. Thanks in
>> advance
>> >> >> for your time.
>> >> >> --
>> >> >> View this message in context:
>> >> >>
>> >>
>> http://www.nabble.com/Unable-to-install-scala-on-the-Mac-tp25195790p2519
>> >> >>5790.html Sent from the Scala mailing list archive at Nabble.com.
>> >
>> >
>> > David Flemström
>> > david.flemstrom@gmail.com
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Unable-to-install-scala-on-the-Mac-tp25195790p2521...
>> Sent from the Scala mailing list archive at Nabble.com.
>>
>>
>
>

Erik Engbrecht
Joined: 2008-12-19,
User offline. Last seen 3 years 18 weeks ago.
Re: Unable to install scala on the Mac
What's you .profile look like?
Mine looks like:## Your previous .profile  (if any) is saved as .profile.mpsaved# Setting the path for MacPorts. export PATH=~/bin:/opt/local/bin:/opt/local/sbin:$PATHexport SCALA_HOME=/usr/local/share/scala#export JAVA_HOME=/opt/local/share/java/openjdk6export ANT_OPTS=-Xmx2galias ll='ls -la'
Notice that when it alters the PATH is concatenates it with the existing PATH.  It looks like wherever scala is being added to the PATH is destroying your existing PATH.
On Sun, Aug 30, 2009 at 3:27 PM, ilango_g <ilangocal@yahoo.com> wrote:

I type in echo $PATH and it returned:
/usr/local/share/scala-2.7.5.final/bin



Erik Engbrecht wrote:
>
> Actually I bet you just messed up your path...
> type: echo $PATH
>
> and see if it has anything on it.
>
> Mine looks like this:
> /opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/git/bin
>
> The stuff in "opt" is for MacPorts.
>
> On Sun, Aug 30, 2009 at 2:43 PM, ilango_g <ilangocal@yahoo.com> wrote:
>
>>
>> It looks like I accidentally deleted all of the standard Unix tools.
>> When I say "which sudo"
>> it says" -bash: which: command not found.
>> if I say "sudo pico .profile
>> it says" -bash: sudo: command not found
>>
>> But I cannot understand how I did that.  What do you suggest I do about
>> the
>> situation?
>>
>> David Flemström wrote:
>> >
>> > Woah... Are you running Scala in a chroot or something? Or have you
>> > accidentally deleted all of the standard UNIX tools? Because those
>> errors
>> > are
>> > really severe.
>> >
>> > My guess is that you've changed your whole PATH instead of appending to
>> > it.
>> > Please try:
>> > export PATH=$SCALA_HOME/bin:$PATH
>> >
>> > instead of:
>> > export PATH=$SCALA_HOME/bin
>> >
>> > ...which is what you probably did.
>> >
>> > On Sunday 30 August 2009 18:53:01 ilango_g wrote:
>> >> I put it in .profle instead because that is where I put my JAVA_HOME
>> and
>> >> this time when I typed in scala
>> >> this is what happened:
>> >>
>> >> samantha-s-imac:bin Samantha$ scala
>> >> /usr/local/share/scala-2.7.5.final/bin/scala: line 12: uname: command
>> not
>> >> found
>> >> /usr/local/share/scala-2.7.5.final/bin/scala: line 18: basename:
>> command
>> >> not found
>> >> /usr/local/share/scala-2.7.5.final/bin/scala: line 29: dirname:
>> command
>> >> not
>> >> found
>> >> /usr/local/share/scala-2.7.5.final/bin/scala: line 47: ls: command not
>> >> found Exception in thread "main" java.lang.NoClassDefFoundError:
>> >> scala/tools/nsc/MainGenericRunner
>> >> Caused by: java.lang.ClassNotFoundException:
>> >> scala.tools.nsc.MainGenericRunner
>> >>     at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
>> >>     at java.security.AccessController.doPrivileged(Native Method)
>> >>     at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>> >>     at java.lang.ClassLoader.loadClass(ClassLoader.java:319)
>> >>     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330)
>> >>     at java.lang.ClassLoader.loadClass(ClassLoader.java:254)
>> >>     at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:402)
>> >> samantha-s-imac:bin Samantha$
>> >>
>> >> -ilango
>> >>
>> >> Viktor Klang wrote:
>> >> > Add the $SCALA_HOME/bin to your PATH in ~/.bash_profile
>> >> >
>> >> > On Fri, Aug 28, 2009 at 9:39 PM, ilango_g <ilangocal@yahoo.com>
>> wrote:
>> >> >> I am trying to install Scala on Mac OS Leopard. I ran the Scala
>> >> >> Installer jar
>> >> >> in /usr/local/share. Unfortunately I cannot run Scala, and I keep
>> >> >> getting the message "-bash: scala: command not found
>> >> >>
>> >> >> If anybody has hints for me, I would appreciate it. Thanks in
>> advance
>> >> >> for your time.
>> >> >> --
>> >> >> View this message in context:
>> >> >>
>> >>
>> http://www.nabble.com/Unable-to-install-scala-on-the-Mac-tp25195790p2519
>> >> >>5790.html Sent from the Scala mailing list archive at Nabble.com.
>> >
>> >
>> > David Flemström
>> > david.flemstrom@gmail.com
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Unable-to-install-scala-on-the-Mac-tp25195790p25214404.html
>> Sent from the Scala mailing list archive at Nabble.com.
>>
>>
>
>
> --
> http://erikengbrecht.blogspot.com/
>
>

--
View this message in context: http://www.nabble.com/Unable-to-install-scala-on-the-Mac-tp25195790p25214815.html
Sent from the Scala mailing list archive at Nabble.com.




--
http://erikengbrecht.blogspot.com/
ilango_g
Joined: 2009-07-15,
User offline. Last seen 42 years 45 weeks ago.
Re: Unable to install scala on the Mac

You guys are right. I seem to have messed up the PATH variable. I can run
"pico" with "/usr/bin and I was able to run pico.

Randall Schulz wrote:
>
> On Sunday August 30 2009, ilango_g wrote:
>> It looks like I accidentally deleted all of the standard Unix tools.
>> When I say "which sudo"
>> it says" -bash: which: command not found.
>> if I say "sudo pico .profile
>> it says" -bash: sudo: command not found
>>
>> But I cannot understand how I did that. What do you suggest I do
>> about the situation?
>
> It's probably more likely that your PATH variable is messed up (or even
> empty). Check that.
>
>
> Randall Schulz
>
>

ilango_g
Joined: 2009-07-15,
User offline. Last seen 42 years 45 weeks ago.
Re: Unable to install scala on the Mac

That worked! Sudo, pico, all started working again. Scala fired up without
issues.
Now my question is: when I issued the command: export PATH="....
Where can I find this PATH variable. It is certainly not written to the
.profile file.

In general if I want to add the path to any new application, say ANT, then I
have to issue the same export PATH="$ANT_HOME/bin:$PATH, etc, right?

David Flemström wrote:
>
> Woah... Are you running Scala in a chroot or something? Or have you
> accidentally deleted all of the standard UNIX tools? Because those errors
> are
> really severe.
>
> My guess is that you've changed your whole PATH instead of appending to
> it.
> Please try:
> export PATH=$SCALA_HOME/bin:$PATH
>
> instead of:
> export PATH=$SCALA_HOME/bin
>
> ...which is what you probably did.
>
> On Sunday 30 August 2009 18:53:01 ilango_g wrote:
>> I put it in .profle instead because that is where I put my JAVA_HOME and
>> this time when I typed in scala
>> this is what happened:
>>
>> samantha-s-imac:bin Samantha$ scala
>> /usr/local/share/scala-2.7.5.final/bin/scala: line 12: uname: command not
>> found
>> /usr/local/share/scala-2.7.5.final/bin/scala: line 18: basename: command
>> not found
>> /usr/local/share/scala-2.7.5.final/bin/scala: line 29: dirname: command
>> not
>> found
>> /usr/local/share/scala-2.7.5.final/bin/scala: line 47: ls: command not
>> found Exception in thread "main" java.lang.NoClassDefFoundError:
>> scala/tools/nsc/MainGenericRunner
>> Caused by: java.lang.ClassNotFoundException:
>> scala.tools.nsc.MainGenericRunner
>> at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
>> at java.security.AccessController.doPrivileged(Native Method)
>> at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>> at java.lang.ClassLoader.loadClass(ClassLoader.java:319)
>> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330)
>> at java.lang.ClassLoader.loadClass(ClassLoader.java:254)
>> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:402)
>> samantha-s-imac:bin Samantha$
>>
>> -ilango
>>
>> Viktor Klang wrote:
>> > Add the $SCALA_HOME/bin to your PATH in ~/.bash_profile
>> >
>> > On Fri, Aug 28, 2009 at 9:39 PM, ilango_g wrote:
>> >> I am trying to install Scala on Mac OS Leopard. I ran the Scala
>> >> Installer jar
>> >> in /usr/local/share. Unfortunately I cannot run Scala, and I keep
>> >> getting the message "-bash: scala: command not found
>> >>
>> >> If anybody has hints for me, I would appreciate it. Thanks in advance
>> >> for your time.
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/Unable-to-install-scala-on-the-Mac-tp25195790p2519
>> >>5790.html Sent from the Scala mailing list archive at Nabble.com.
>
>
> David Flemström
> david.flemstrom@gmail.com
>
>

Ricky Clarkson
Joined: 2008-12-19,
User offline. Last seen 3 years 2 weeks ago.
Re: Unable to install scala on the Mac

PATH is an environment variable. If you issue export PATH=... in a
running shell, then that value persists while that shell does, rather
like a local variable in Scala. Rather unlike a local variable in
Scala, it is automatically propagated to any processes that the shell
launches.

If you want it to be permanent, you need to write that line in a file
that gets 'sourced' when a new shell starts, such as ~/.bashrc.
Spending some time learning your shell would probably be useful. man
bash.

You are correct about ant.

2009/9/2 ilango_g :
>
> That worked! Sudo, pico, all started working again. Scala fired up without
> issues.
> Now my question is: when I issued the command: export PATH="....
> Where can I find this PATH variable. It is certainly not written to the
> .profile file.
>
> In general if I want to add the path to any new application, say ANT, then I
> have to issue the same export PATH="$ANT_HOME/bin:$PATH, etc, right?
>
>
>
> David Flemström wrote:
>>
>> Woah... Are you running Scala in a chroot or something? Or have you
>> accidentally deleted all of the standard UNIX tools? Because those errors
>> are
>> really severe.
>>
>> My guess is that you've changed your whole PATH instead of appending to
>> it.
>> Please try:
>> export PATH=$SCALA_HOME/bin:$PATH
>>
>> instead of:
>> export PATH=$SCALA_HOME/bin
>>
>> ...which is what you probably did.
>>
>> On Sunday 30 August 2009 18:53:01 ilango_g wrote:
>>> I put it in .profle instead because that is where I put my JAVA_HOME and
>>> this time when I typed in scala
>>> this is what happened:
>>>
>>> samantha-s-imac:bin Samantha$ scala
>>> /usr/local/share/scala-2.7.5.final/bin/scala: line 12: uname: command not
>>> found
>>> /usr/local/share/scala-2.7.5.final/bin/scala: line 18: basename: command
>>> not found
>>> /usr/local/share/scala-2.7.5.final/bin/scala: line 29: dirname: command
>>> not
>>> found
>>> /usr/local/share/scala-2.7.5.final/bin/scala: line 47: ls: command not
>>> found Exception in thread "main" java.lang.NoClassDefFoundError:
>>> scala/tools/nsc/MainGenericRunner
>>> Caused by: java.lang.ClassNotFoundException:
>>> scala.tools.nsc.MainGenericRunner
>>>     at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
>>>     at java.security.AccessController.doPrivileged(Native Method)
>>>     at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>>>     at java.lang.ClassLoader.loadClass(ClassLoader.java:319)
>>>     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330)
>>>     at java.lang.ClassLoader.loadClass(ClassLoader.java:254)
>>>     at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:402)
>>> samantha-s-imac:bin Samantha$
>>>
>>> -ilango
>>>
>>> Viktor Klang wrote:
>>> > Add the $SCALA_HOME/bin to your PATH in ~/.bash_profile
>>> >
>>> > On Fri, Aug 28, 2009 at 9:39 PM, ilango_g wrote:
>>> >> I am trying to install Scala on Mac OS Leopard. I ran the Scala
>>> >> Installer jar
>>> >> in /usr/local/share. Unfortunately I cannot run Scala, and I keep
>>> >> getting the message "-bash: scala: command not found
>>> >>
>>> >> If anybody has hints for me, I would appreciate it. Thanks in advance
>>> >> for your time.
>>> >> --
>>> >> View this message in context:
>>> >>
>>> http://www.nabble.com/Unable-to-install-scala-on-the-Mac-tp25195790p2519
>>> >>5790.html Sent from the Scala mailing list archive at Nabble.com.
>>
>>
>> David Flemström
>> david.flemstrom@gmail.com
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Unable-to-install-scala-on-the-Mac-tp25195790p2525...
> Sent from the Scala mailing list archive at Nabble.com.
>
>

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland