LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   scala 2.11.7 not run without root permissions, jdk 1.8.0u60 (https://www.linuxquestions.org/questions/slackware-14/scala-2-11-7-not-run-without-root-permissions-jdk-1-8-0u60-4175554036/)

ginkgo 09-20-2015 10:37 PM

scala 2.11.7 not run without root permissions, jdk 1.8.0u60
 
Hi everybody,
I current study the scala, but I meet some problems, I install the slackware-current 32bit in the vmware, And install the jdk 1.8.0u60 and scala-2.11.7, with the root user, I can enter interactive mode , ane everything is ok. When I change to normal user, I can NOT run the scala interactive, but run scala --version can correct output the info.

So I install the centos 7.1 mini, the same jdk and scala , the normal user can run fine.

Can someone help me? I like the slackware and do not want to change to centos.


regard

Richard Cranium 09-21-2015 12:06 AM

How did you install scala?

knudfl 09-21-2015 02:29 AM

1 Attachment(s)
Slackware : You can use the Slackbuild ...
http://slackbuilds.org/repository/14...lopment/scala/
... and use scala-2.11.7.tgz instead of scala-2.7.7.final.tgz .

Edit the scala.SlackBuild to the new version :
Line 9 to : VERSION=${VERSION:-2.11.7}
Line 49 : mv $TMP/$PRGNAM-$VERSION/{bin,lib,man} $PKG/$LIBDIR/$PRGNAM

( The edited scala.SlackBuild is attached.)
-

ginkgo 09-21-2015 07:52 PM

I install jdk and scala ,use the build script form slackbuilds, just like @knudfl said. the root user is fine,

http://i11.tietuku.com/e6a144555cd4e39d.png

ponce 09-21-2015 11:24 PM

trying to translate the error, it seems the scala interpreter is not able to find java.
wild guessing:
have you reboot your virtual machine after installing jdk?

ginkgo 09-22-2015 02:57 AM

yes, I reboot the machine, the root user can run fine, just logout and change to normal user, the result is upper pic.

http://i3.tietuku.com/660c5516e1b4caa2.png

this is the root screen snap.

ponce 09-22-2015 03:19 AM

here it works, on 32 and 64bit.

the only difference that I seem to spot in the output from your screens is that I have a "Server VM", not a "Client VM"
Code:

$ scala
Welcome to Scala version 2.11.7 (Java HotSpot(TM) Server VM, Java 1.8.0_60).
Type in expressions to have them evaluated.
Type :help for more information.

scala> 1 + 2
res0: Int = 3

have you by any chance installed jre instead of jdk from SBo?

(most probably shouldn't matter but it won't hurt) are you using a full install of Slackware?

Alien Bob 09-22-2015 06:08 AM

Quote:

Originally Posted by ponce (Post 5423826)
here it works, on 32 and 64bit.

the only difference that I seem to spot in the output from your screens is that I have a "Server VM", not a "Client VM"
Code:

$ scala
Welcome to Scala version 2.11.7 (Java HotSpot(TM) Server VM, Java 1.8.0_60).
Type in expressions to have them evaluated.
Type :help for more information.

scala> 1 + 2
res0: Int = 3

have you by any chance installed jre instead of jdk from SBo?

(most probably shouldn't matter but it won't hurt) are you using a full install of Slackware?

The client or server VM selection is not dependent on using the JDK or the JRE. It is done by Java based on the hardware it is running on: see http://docs.oracle.com/javase/8/docs...ver-class.html

ponce 09-22-2015 06:17 AM

Quote:

Originally Posted by Alien Bob (Post 5423870)
The client or server VM selection is not dependent on using the JDK or the JRE. It is done by Java based on the hardware it is running on: see http://docs.oracle.com/javase/8/docs...ver-class.html

thanks Eric for clarifying this!

Richard Cranium 09-22-2015 08:16 AM

Perhaps the scala interpreter is writing to a file somewhere that is owned by root. Or one of the jars that it is using has incorrect permissions.

ponce 09-22-2015 03:56 PM

last thing I can think to let you try is upgradepkg your packages with the ones I built here

(link removed)

ginkgo 09-22-2015 08:27 PM

Good news and strange news. I download the new slackware-current from Alien site, I install the new vmware machine full install all except the kde,kdel.

I installpkg the 2 package that ponce post, the scala run fine. That is a good new.

Thanks Ponce, Alien, Eric and other guys .


btw. ponce can you share the script of jdk,scala, or can you figure out the different with the slackbuilds.

ponce 09-23-2015 12:16 AM

for jdk I used the one on SBo, for scala you can find it in /usr/doc/scala-2.11.7/scala.SlackBuild


All times are GMT -5. The time now is 02:04 PM.