Getting java errors trying to run leiningen - clojure

I'm trying to build a project that uses leiningen -- though my issue seems to be with leiningen and not with the project.
When I run lein figwheel dev (for a project that has a /dev folder configured correctly) I get the following:
Figwheel: Cutting some fruit, just a sec ...
Unrecognized option: --add-modules
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Which indicates it's an error with the JVM, but I'm not familiar enough with working with any of JVM / clojure / lein to know what I should be doing to fix it.
Some (hopefully!) helpful information about my stack:
$ java --version
openjdk 11.0.1 2018-10-16
OpenJDK Runtime Environment (build 11.0.1+13-Debian-2)
OpenJDK 64-Bit Server VM (build 11.0.1+13-Debian-2, mixed mode, sharing)
$ lein --version
Leiningen 2.8.1 on Java 1.8.0_171 OpenJDK 64-Bit Server VM

Clone this repo and see if it solves your problems: https://github.com/cloojure/cljs-template
Be sure to read the README.txt file and follow the instructions.
For this project, all you need is:
> lein figwheel
I'm not sure what you have in your ./dev folder - that's probably the problem.

Related

clj repl crashing when launched and pwd is ~

clj repl crashing when launched and pwd is ~, otherwise from any other directory it's fine.
I installed clojure following instructions from
https://clojure.org/guides/getting_started#_installation_on_linux
However, when i launch the repl staying in ~, I get following
Exception in thread "main" java.lang.IllegalStateException: Attempting to call unbound fn: #'clojure.main/main
at clojure.lang.Var$Unbound.throwArity(Var.java:45)
at clojure.lang.AFn.invoke(AFn.java:28)
at clojure.lang.AFn.applyToHelper(AFn.java:152)
at clojure.lang.AFn.applyTo(AFn.java:144)
at clojure.lang.Var.applyTo(Var.java:705)
at clojure.main.main(main.java:40)
And if i change the directory to any other location, it runs ok
:~/src$ clj
Clojure 1.10.3
user=>
My OS is a Debian Buster (Minimal)... I tried looking up, but to no avail...I also have no clue as to what to look for...
Not sure if following is of any help...
:~$ mvn --version
Apache Maven 3.6.0
Maven home: /usr/share/maven
Java version: 11.0.11, vendor: Debian, runtime: /usr/lib/jvm/java-11-openjdk-amd64
Default locale: en_IN, platform encoding: UTF-8
OS name: "linux", version: "4.19.0-17-amd64", arch: "amd64", family: "unix"
:~$ java --version
openjdk 11.0.11 2021-04-20
OpenJDK Runtime Environment (build 11.0.11+9-post-Debian-1deb10u1)
OpenJDK 64-Bit Server VM (build 11.0.11+9-post-Debian-1deb10u1, mixed mode, sharing)
The cause of the behavior is explained in one of the comments by Sean Corfield on Clojure Q&A.

problems installing clojure lein under mac os 10.13.6

I am using Homebrew with the command brew install leiningen but trying lein repl gives
java.lang.ClassCastException: java.lang.Character cannot be cast to java.uti
l.Map$Entr
followed by many pages ending with
clojure.main.main (main.java:37)
the same happens with Macports or supplied script, boot installs perfectly with Homebrew.
I am learning Clojure from the Brave and True book which needs lein repl
To "install" lein just download the download script from the web page and run it :
https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein
Hope it helps
Consider using sdkman, even if leiningen is straightforward to use:
curl -s "https://get.sdkman.io" | bash
Then open a new terminal and type:
sdk install leiningen
Now try your:
lein repl
While you're at it, sdk can be used to manage your Java installations. Never again worry about dirtying your system with various versions, as they all go in your home directory, cleanly.

Installing RQuantLib on RStudio AWS AMI

there have been some similar questions (Installing RQuantLib on Linux), but none related to the AWS RStudio environment. After trying the usual rute
install.packages('RQuantLib');
library(devtools)
install_github("eddelbuettel/rquantlib")
I get the following error (in both cases):
configure: error: Please install QuantLib before trying to build RQuantLib.
ERROR: configuration failed for package ‘RQuantLib’.
Also, all of a sudden (after upgrading R on my local machine from 3.4.4 to 3.5.0) RQuantLib stopped working also on my local Windows machine:
Error in system(full, intern = TRUE, ignore.stderr = quiet, ...) :
running command '"C:/PROGRA~1/R/R-35~1.0/bin/x64/R" --no-site-file --no- environ --no-save --no-restore --quiet CMD config CC' had status 1
After following the directions on the Github page I tried the following:
if (!require("drat")) install.packages("drat")
drat::addRepo("ghrr")
install.packages("RQuantLib", type="binary")
but got the follwoing error:
Warning in install.packages :
unable to access index for repository https://ghrr.github.io/drat/bin/windows/contrib/3.5:
cannot open URL 'https://ghrr.github.io/drat/bin/windows/contrib/3.5/PACKAGES'
Warning in install.packages :
package ‘RQuantLib’ is not available (as a binary package for R version 3.5.0)
What else could I try? The AWS problem has a higher priority, although I would really like to be able to use RQuantLib on my local machine again, so any help would be really appreciated.
A small end note: The RQuantLib library compiles succesfully on the Debian 16.04 AWS AMI, but not on the RStudio AMI.
Windows builds, just like Unix builds, require QuantLib to be present which has its challenges.
The most recent upload restores this ability, utilising a GitHub repo with a prebuilt version of QuantLib. Try installing RQuantLib 0.4.5 now on Windows; you should get a binary from CRAN as can been on the CRAN page.

Jetty Version 9 throws java.lang.NoClassDefFoundError for Embedded Server

I decided to upgrade Jetty in order to add support for HTTPS connections. The build was done successfully by Maven and the code runs on Java 7 JRE.
After an upgrade from Jetty 8 (8.1.8.v20121106) to Jetty Version 9 (9.2.14.v20151106) using an embedded server code, I get the following error at the begin of the Jetty server startup.
Any hint what is causing the error at the classloader?
sh ./testit.sh
Exception in thread "main" java.lang.NoClassDefFoundError: org.eclipse.jetty.server.HttpConfiguration$Customizer
at java.lang.J9VMInternals.verifyImpl(Native Method)
at java.lang.J9VMInternals.verify(J9VMInternals.java:94)
at java.lang.J9VMInternals.prepare(J9VMInternals.java:514)
at java.lang.Class.getMethod(Class.java:1113)
at sun.launcher.LauncherHelper.getMainMethod(LauncherHelper.java:507)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:499)
Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.server.HttpConfiguration$Customizer
at java.net.URLClassLoader.findClass(URLClassLoader.java:600)
at java.lang.ClassLoader.loadClassHelper(ClassLoader.java:777)
at java.lang.ClassLoader.loadClass(ClassLoader.java:750)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:326)
at java.lang.ClassLoader.loadClass(ClassLoader.java:731)
... 6 more
I've isolated the error cause. The Maven build tool added the Jetty distribution version number to the target libraries, which did not match my Java static classpath configuration. After correcting the classpath setting in the startup script, the program code started the embedded Jetty 9 server and worked just fine for my project.
#Joakim Erdfelt this is my Java version
java -version
java version "1.7.0"
Java(TM) SE Runtime Environment (build pxa6470sr9fp10-20150708_01(SR9 FP10))
IBM J9 VM (build 2.6, JRE 1.7.0 Linux amd64-64 Compressed References 20150701_255667 (JIT enabled, AOT enabled)
J9VM - R26_Java726_SR9_20150701_0050_B255667
JIT - tr.r11_20150626_95120.01
GC - R26_Java726_SR9_20150701_0050_B255667_CMPRSS
J9CL - 20150701_255667)
JCL - 20150628_01 based on Oracle jdk7u85-b15

Error when trying to build Clojure boot file in Ubuntu 12.04

I am starting out with Clojure, and i am currently following the hoplon.io get started tutorial
My troubles start when i try to build boot from source: (http://github.com/tailrecursion/boot)
This is the error that i receive when running the make boot command:
1 required artifact is missing.
for artifact:
org.apache.maven:super-pom:pom:2.0
from the specified remote repositories:
central (http://repo1.maven.org/maven2),
clojars (http://clojars.org/repo/)
I have installed maven but that did not change anything. Has anyone encountered this problem aswell?
Best Regards
Daniel