Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot build with sbt #24

Open
antonkulaga opened this issue Oct 21, 2013 · 16 comments
Open

Cannot build with sbt #24

antonkulaga opened this issue Oct 21, 2013 · 16 comments

Comments

@antonkulaga
Copy link

When I try to build with sbt I get:

Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? r
error: error while loading CharSequence, class file '/usr/lib/jvm/java-8-oracle/jre/lib/rt.jar(java/lang/CharSequence.class)' is broken
(bad constant pool tag 15 at byte 1484)
[error] Type error in expression

@MasseGuillaume
Copy link

use java 7 ?

@drdozer
Copy link

drdozer commented Nov 5, 2013

Using Java 7 is not a very good option when Java is installed system-wide. I have this problem and it looks like the sbt launcher juses whatever java is in the PATH. I tried setting JAVA_HOME and JDK_HOME but it still takes the default Java.

This needs 2 levels of fix. Firstly, some way to tell the launcher to use an alternative JDK, secondly a patch to SBT so that it will run under Java 8.

@antonkulaga
Copy link
Author

Old scala 2.9x does not work with Java8 So the only way to make it work with JDK8 is to use Scala 2.10 and sbt 0.13 (as sbt 0.12 uses scala 2.9x internally).

@drdozer
Copy link

drdozer commented Nov 5, 2013

Updating the system-wide default Java version for one application (sbt) is a bit of a drag. I ended up writing a script that pushes Java7 onto the front of my PATH before execing the real sbt script. Functional but eugh!

@nightscape
Copy link
Contributor

I had the same problem and changed my sbt launcher script to read

#!/bin/bash
test -f ~/.sbtconfig && . ~/.sbtconfig
exec $JAVACMD -Xmx1512M ${SBT_OPTS} -jar /usr/local/Cellar/sbt/0.13.0/libexec/sbt-launch.jar "$@"

Now I can use another Java version for sbt with

export JAVACMD=/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/bin/java
sbt

Note that although the launcher explicitly mentions 0.13.0 the sbt-launch.jar should spawn the sbt version specified in build.properties.

@lukaseder
Copy link

I had the same problem in an entirely different context, when building jOOQ-scala with Maven and Java 8:
https://travis-ci.org/jOOQ/jOOQ/jobs/23113386

[INFO] Checking for multiple versions of scala
[INFO] includes = [**/*.java,**/*.scala,]
[INFO] excludes = []
[INFO] /home/travis/build/jOOQ/jOOQ/jOOQ-scala/src/main/scala:-1: info: compiling
[INFO] Compiling 1 source files to /home/travis/build/jOOQ/jOOQ/jOOQ-scala/target/classes at 1397648489988
[ERROR] error: error while loading CharSequence, class file '/usr/lib/jvm/java-8-oracle/jre/lib/rt.jar(java/lang/CharSequence.class)' is broken
[INFO] (bad constant pool tag 15 at byte 1501)
[ERROR] one error found`

I suspect that there is a Scala / Java 8 issue

@timomeinen
Copy link

/usr/libexec/java_home -v 1.7 gives the path to the JDK 1.7. You can change your sbt start script in the meantime:

cat /usr/local/bin/sbt 
#!/bin/sh
test -f ~/.sbtconfig && . ~/.sbtconfig
exec /usr/libexec/java_home -v 1.7 --exec java -Xmx512M ${SBT_OPTS} -jar /usr/local/Cellar/sbt/0.13.2/libexec/sbt-launch.jar "$@"

@svanschalkwyk
Copy link

Scala 2.10.3:
(server/compile:jsSourceGraph) java.io.FileNotFoundException: https://raw.githubusercontent.com/cloudhead/less.js/master/dist/less-1.3.3.js

@andypetrella
Copy link

@svanschalkwyk you're right, I had to fix it in my fork. I switch to a CDN → see https://github.com/andypetrella/spark-notebook/blob/spark/server/src/main/assets/thirdparty/static/less.jsm

@svanschalkwyk
Copy link

Much appreciated!
Getting "unauthorized" in web page. Will look some more.

On Sun, Nov 2, 2014 at 2:04 PM, Andy Petrella [email protected]
wrote:

@svanschalkwyk https://github.com/svanschalkwyk you're right, I had to
fix it in my fork. I switch to a CDN → see
https://github.com/andypetrella/spark-notebook/blob/spark/server/src/main/assets/thirdparty/static/less.jsm


Reply to this email directly or view it on GitHub
#24 (comment)
.


Remcam LLC http://remcam.net
http://remcam.net
Google Voice & SMS: +1 312 281 8982 (rings all lines)
Skype: svanschalkwyk

http://linkedin.com/in/vanschalkwyk

@andypetrella
Copy link

If you want to use URL rather than the page opened by the app, you will
have this error (security via cookie token not found).
So =>

project server
run --disable_security

Will disable the security and let you use the app in DEV mode (let's say),
thus reloading page at will.

HTH

@svanschalkwyk
Copy link

Thanks!

On Sun, Nov 2, 2014 at 2:17 PM, Andy Petrella [email protected]
wrote:

If you want to use URL rather than the page opened by the app, you will
have this error (security via cookie token not found).
So =>

project server
run --disable_security

Will disable the security and let you use the app in DEV mode (let's say),
thus reloading page at will.

HTH


Reply to this email directly or view it on GitHub
#24 (comment)
.


Remcam LLC http://remcam.net
http://remcam.net
Google Voice & SMS: +1 312 281 8982 (rings all lines)
Skype: svanschalkwyk

http://linkedin.com/in/vanschalkwyk

@svanschalkwyk
Copy link

Thanks Andy. Much appreciated!
How can I do the same as I'm doing here:
KERNEL_CMD="["java", "-cp", "${ALL_LIBS}", "$JAVA_NATIVE",
"${MEMSIZE}", "-Xms128M", "-Dfile.encoding=UTF-8",
"org.refptr.iscala.IScala", "--profile", "{connection_file}",
"--parent", "$@"]"

ipython notebook --profile scala

--KernelManager.kernel_cmd="$KERNEL_CMD"
Regards
Steph
PS. I'm new to Linux, new to Scala, new to the entire dark side. Been doing
MSFT since 92...

On Sun, Nov 2, 2014 at 2:45 PM, Steph van Schalkwyk [email protected] wrote:

Thanks!

On Sun, Nov 2, 2014 at 2:17 PM, Andy Petrella [email protected]
wrote:

If you want to use URL rather than the page opened by the app, you will
have this error (security via cookie token not found).
So =>

project server
run --disable_security

Will disable the security and let you use the app in DEV mode (let's say),
thus reloading page at will.

HTH


Reply to this email directly or view it on GitHub
#24 (comment)
.


Remcam LLC http://remcam.net
http://remcam.net
Google Voice & SMS: +1 312 281 8982 (rings all lines)
Skype: svanschalkwyk
http://linkedin.com/in/vanschalkwyk



Remcam LLC http://remcam.net
http://remcam.net
Google Voice & SMS: +1 312 281 8982 (rings all lines)
Skype: svanschalkwyk

http://linkedin.com/in/vanschalkwyk

@andypetrella
Copy link

@svanschalkwyk actually, I dunno, this command look quite weird to me :-D. I'm using the notebook tru sbt only.
In a sense, this command looks pretty like a classical IPython one no?

@svanschalkwyk
Copy link

Hi
Yes, it does look weird
The kernel keeps on stopping, so something is wrong.
S


Remcam LLC http://remcam.net
Google Voice & SMS: +1 312 281 8982 (rings all lines)
Skype: svanschalkwyk

http://linkedin.com/in/vanschalkwyk

On Nov 2, 2014 2:58 PM, "Andy Petrella" [email protected] wrote:

@svanschalkwyk https://github.com/svanschalkwyk actually, I dunno, this
command look quite weird to me :-D. I'm using the notebook tru sbt only.
In a sense, this command looks pretty like a classical IPython one no?


Reply to this email directly or view it on GitHub
#24 (comment)
.

@shkr
Copy link

shkr commented Dec 21, 2014

I have sbt 0.13 and jdk 1.8 . it is compiling on scalac 2.10 but I have the same error
"java.io.FileNotFoundException: https://raw.githubusercontent.com/cloudhead/less.js/master/dist/less-1.3.3.js"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants