JAVA_OPTS not accessible in my Clojure project

369 views
Skip to first unread message

aidy lewis

unread,
Jan 10, 2014, 7:42:02 AM1/10/14
to clo...@googlegroups.com

Clojurians,

For some reason JAVA_OPTS are not accessible in my Clojure project.

The command line seems to be OK, if I:

$ lein repl

project-ns =>  (System/getProperty "javax.net.ssl.keyStore")

-> "/../certs/dev.bbc.co.uk.p12"


However, if I load the nRepl in the lein project:

project-ns =>  (System/getProperty "javax.net.ssl.keyStore")

-> nil

Not sure why this is the case?

Thanks

--
@AidyLewis

juan.facorro

unread,
Jan 10, 2014, 12:47:17 PM1/10/14
to clo...@googlegroups.com
Hi Aidy,

What do mean when you say "load the nRepl in the lein project"?

Juan

aidy lewis

unread,
Jan 10, 2014, 2:45:59 PM1/10/14
to clo...@googlegroups.com
Hi Juan,

Maybe I should rephrase my issue.

If I create a new leiningen project

$ lein new foo

And type

$ lein repl

user=>  (System/getProperty "javax.net.ssl.keyStore")

> /Users/lewisa29/certs/dev.bbc.co.uk.p12

Now if I enter this into core.clj of the foo project

(ns foo.core)

(System/getProperty "javax.net.ssl.keyStore") ;; C-x C-e

And execute this function through the Emacs CIDER REPL, I receive 'nil'.

Why can I not access the keystore in $JAVA_OPTS in my project?

Thanks

Aidy


 


--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
@AidyLewis

Matching Socks

unread,
Jan 12, 2014, 12:25:52 AM1/12/14
to clo...@googlegroups.com
How did you start the Emacs Cider REPL?

aidy lewis

unread,
Jan 12, 2014, 6:38:07 AM1/12/14
to clo...@googlegroups.com
Hi Phil,

M-x cider-jack-in, but the JAVA_OPT properties are also nil if I do a lein run. 

Thanks

Aidy 


On 12 January 2014 05:25, Matching Socks <phill...@gmail.com> wrote:
How did you start the Emacs Cider REPL?

--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
@AidyLewis

dennis zhuang

unread,
Jan 12, 2014, 9:30:50 AM1/12/14
to Clojure
Tried System/getenv ?


2014/1/12 aidy lewis <aidy....@gmail.com>



--
庄晓丹
Email:        killm...@gmail.com xzh...@avos.com
Site:           http://fnil.net
Twitter:      @killme2008


Matching Socks

unread,
Jan 12, 2014, 7:25:23 PM1/12/14
to clo...@googlegroups.com
The Leiningen sample project https://github.com/technomancy/leiningen/blob/master/sample.project.clj
refers to a :jvm-opts key and a JVM_OPTS environment variable.

aidy lewis

unread,
Jan 13, 2014, 3:29:46 AM1/13/14
to clo...@googlegroups.com
Hi Phill, 

Thanks for the heads up.

I've entered this in project.clj
:jvm-opts ["javax.net.ssl.keyStore"]

Restarted the CIDER REPL and entered in core.clj

(System/getProperty "javax.net.ssl.keyStore") 

I evaluated that expression and it returns nil. 

But, if I go to the command-line and at the root of the project type 'lein repl'

a-project.core=> (System/getProperty "javax.net.ssl.keyStore")

The certificate path is returned

> ./certs/dev.bbc.co.uk.p12\

Many Thanks

Aidy





On 13 January 2014 00:25, Matching Socks <phill...@gmail.com> wrote:
The Leiningen sample project https://github.com/technomancy/leiningen/blob/master/sample.project.clj
refers to a :jvm-opts key and a JVM_OPTS environment variable.

--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
@AidyLewis

Softaddicts

unread,
Jan 13, 2014, 4:46:27 AM1/13/14
to clo...@googlegroups.com
To set java properties on the cmd line you need to enter something like:

-Djavax.net.ssl.keyStore=value

try

:jvm-opts ["-Djavax.net.ssl.keyStore=full-spec-of-your-file"]

Luc P.
Softaddicts<lprefo...@softaddicts.ca> sent by ibisMail from my ipad!

aidy lewis

unread,
Jan 13, 2014, 5:34:59 AM1/13/14
to clo...@googlegroups.com
Hi Softaddicts 

Thanks for the advice, but my aim was to retrieve the JAVA_OPTS from my environment variables in order to not hard-code them.

Aidy

aidy lewis

unread,
Jan 13, 2014, 7:23:35 AM1/13/14
to clo...@googlegroups.com
The problem - if anyone is interested - is that I had not set $JAVA_OPTS in the Emacs config file.

Sorry, for being a balloon. 

Thanks

Aidy 
--
@AidyLewis
Reply all
Reply to author
Forward
0 new messages