2024 Clojure状态调查!分享您的想法。

欢迎!请查看关于页面,了解更多关于这里是如何工作的信息。

0
编译器

大家好,我基本上是想运行一个使用shadow文件的Clojure脚本应用程序,说实话我对Clojure不太了解,因为这个项目是我下载的,但我需要它在Windows 11上本地运行,我只收到以下错误

shadow-cljs - 配置:C:\Appsmiths\i\src\winglue\webglue\shadow-cljs.edn
===== ERROR =================

系统路径中没有找到可执行程序 'java'。

当然,我系统中有Java,环境变量也配置得很好,所以我想这可能是shadow文件内的某个问题,但我无法确定是什么,如果你能帮我解决这个问题,将会非常有用

以下就是基本的shadow配置

;; shadow-cljs configuration
{:dependencies [
                [akiroz.re-frame/storage "0.1.3"]
                [bidi "2.1.5"]
                [com.cemerick/url "0.1.1"]
                [binaryage/devtools "1.0.2"]
                [binaryage/oops "0.7.1"]
                [com.cognitect/transit-cljs "0.8.256"]
                [com.rpl/specter "1.1.3"]
                [com.taoensso/timbre "4.10.0"]
                [cljs-http "0.1.46"]
                [day8.re-frame/async-flow-fx "0.1.0"]
                [day8.re-frame/http-fx "0.1.6"]
                [day8.re-frame/re-frame-10x "1.5.0"]
                [day8.re-frame/tracing "0.5.1"]
                [day8.re-frame/undo "0.3.2"]
                [district0x/graphql-query "1.0.6"]
                [district0x/re-frame-interval-fx "1.0.2"]
                [expound "0.8.5"]
                [funcool/cuerdas "2021.05.29-0"]
                [funcool/promesa "2.0.1"]
                [juji/editscript "0.4.6"]
                [maximgb/re-state "1.5.0"]
                [medley "1.2.0"]
                [metosin/spec-tools "0.10.4"]
                [org.clojure/data.json "0.2.6"]
                [org.clojure/spec.alpha "0.2.187"]
                [pez/clerk "1.0.0"]
                [prismatic/schema "1.1.12"]
                [re-frame "1.3.0"]
                [re-graph "0.1.15" :exclusions [cljs-http]]
                [com.andrewmcveigh/cljs-time "0.5.2"]
                [reagent "1.1.1"]
                [spyscope "0.1.6"]
                [venantius/accountant "0.2.5"]
                [lambdaisland/regal "0.0.143"]
                [cheshire "5.11.0"]
                [camel-snake-kebab "0.4.3"]
                [garden/garden-units "1.0.0-RC2"]
                [cljs-bean "1.8.0"]]

 :source-paths ["lib" "graphql" "src" "C:/Appsmiths/i/src/winglue-artifact/webglue" "test"]
 :nrepl {:port 41002}
 :open-file-command ["idea " :pwd " --line " :line :file]
 ;; webglue artifact are in /i/src/winglue-artifact/webglue/js
 :builds {:app {:output-dir "C:/Appsmiths/i/src/winglue-artifact/webglue/js"
                :asset-path "/js"
                :compiler-options
                {:optimizations :none
                 ;; use es2018 for recat-markdown-editor
                 :output-feature-set :es2018
                 :main webglue.core
                 :closure-warnings {:global-this :off}
                 :closure-defines {re-frame.trace/trace-enabled? true
                                   day8.re-frame-10x.debug?             true
                                   day8.re-frame.tracing.trace-enabled? true}
                 :external-config {:devtools/config {:features-to-install    [:formatters :hints]
                                                     :fn-symbol              "Fn"
                                                     :print-config-overrides true}}}
                :target :browser
                :js-options {:ignore-asset-requires true}
                :module-loader true
                :modules {:webglue
                          {:entries [webglue.core]}
                          :ag-grid
                          {:entries [webglue.components.ag-grid]
                           :depends-on #{:webglue}}
                          :dev
                          {:entries [webglue.pages.component-show-case webglue.pages.dev]
                           :depends-on #{:webglue}}
                          :plot
                          {:entries [webglue.component-generator.graph
                                     webglue.component-generator.ivsp-plot
                                     webglue.component-generator.pie-chart
                                     webglue.component-generator.bar-chart
                                     webglue.component-generator.bubble-chart]
                           :depends-on #{:webglue}}}
                :devtools {:repl-pprint true
                           :after-load webglue.core/reload!
                           :loader-mode :eval
                           :http-root "C:/Appsmiths/i/src/winglue-artifact/webglue"
                           :http-port 3333
                           :http-handler shadow.http.push-state/handle
                           :preloads [devtools.preload
                                      ; use only for debug re-frame, this option wil take 300 ms to reload and 330 file to watch
                                      ; run by uncomment next line, and save. shadow-cljs will do the rest
                                      day8.re-frame-10x.preload]}}
          :win-app {:output-dir "C:/Appsmiths/i/src/winglue-artifact/webglue"
                    :asset-path "/js"
                    :compiler-options
                    {:optimizations :none
                     :output-feature-set :es2018
                     :main webglue.core
                     :closure-warnings {:global-this :off}
                     :closure-defines {re-frame.trace/trace-enabled? true
                                       day8.re-frame-10x.debug?             true
                                       day8.re-frame.tracing.trace-enabled? true}
                     :external-config {:devtools/config {:features-to-install    [:formatters :hints]
                                                         :fn-symbol              "Fn"
                                                         :print-config-overrides true}}}
                    :target :browser
                    :js-options {:ignore-asset-requires true}
                    :modules {:webglue {:entries [webglue.core]}}
                    :devtools {:http-port 3434
                               :http-root "C:/Appsmiths/i/src/winglue-artifact/webglue"
                               :http-handler shadow.http.push-state/handle
                               :after-load webglue.core/reload!
                               :loader-mode :eval
                               :preloads [devtools.preload
                                          day8.re-frame-10x.preload]}}
          :test {:target :browser-test
                 :test-dir "test-assets"
                 :devtools {:http-port 9100
                            :http-root "test-assets"}
                 :runner-ns main-test-initial
                 :js-options {:ignore-asset-requires true}
                 :ns-regexp "-test$"}

          :app-release {:target :browser
                        :modules {:webglue
                                  {:entries [webglue.core]}}
                        :js-options {:ignore-asset-requires true}
                        :compiler-options {:source-map false
                                           :output-feature-set :es2018
                                           :main  webglue.core
                                           :closure-defines {}}
                        :release  {:output-dir "C:/Appsmiths/i/src/winglue-artifact/webglue/js"}}

          :tao2py-release {:target :browser
                           :js-options {:ignore-asset-requires true}
                           :compiler-options
                           {:source-map false
                            :output-feature-set :es2018
                            :main  webglue.core
                            :closure-defines {webglue.config/tao2py-release true
                                              ;; landing page is page key in webglue.route_pages
                                              webglue.config/landing-page "field-overview"}}
                           :release  {:output-dir "C:/Appsmiths/i/src/winglue-artifact/webglue/js"
                                      :asset-path "/js"}
                           :module-loader true
                           :modules {:webglue
                                     {:entries [webglue.core]}
                                     :ag-grid
                                     {:entries [webglue.components.ag-grid]
                                      :depends-on #{:webglue}}
                                     :dev
                                     {:entries [webglue.pages.component-show-case webglue.pages.dev]
                                      :depends-on #{:webglue}}
                                     :plot
                                     {:entries [webglue.component-generator.graph
                                                webglue.component-generator.ivsp-plot
                                                webglue.component-generator.pie-chart
                                                webglue.component-generator.bar-chart
                                                webglue.component-generator.bubble-chart]
                                      :depends-on #{:webglue}}}}

          :tao2py-testing {:target :browser
                           :modules {:webglue
                                     {:entries [webglue.core]}}
                           :js-options {:ignore-asset-requires true}
                           :compiler-options {:source-map false
                                              :output-feature-set :es2018
                                              :main  webglue.core
                                              :closure-defines {}}
                           :release  {:output-dir "C:/Appsmiths/i/src/winglue-artifact/webglue/js"}}

          :budger-release {:target :browser
                           :modules {:webglue {:entries [webglue.core]}}
                           :release {:output-dir "release/js"}
                           :js-options {:ignore-asset-requires true}
                           :compiler-options {:source-map false
                                              :output-feature-set :es2018
                                              :main       webglue.core
                                              :closure-defines {}}}}}
如果你打开命令提示符并输入 "java --version"(不带引号),会发生什么?
我得到

java 21.0.1 2023-10-17 LTS
Java(TM) SE运行环境(版本21.0.1+12-LTS-29)
Java HotSpot(TM) 64位服务器虚拟机(版本21.0.1+12-LTS-29,混合模式,共享)
好吧,这看起来很有希望。你实际上运行了什么命令?
我们使用两个命令运行应用程序,其中一个是为Windows准备的

"win:start": "npm run win:buildcss && npm run win:watch", (在package.json中)

但出了错误,所以我决定运行

 npx shadow-cljs compile app

但仍然出现同样的错误
非常有趣 - 这些细节很有帮助。我并不确切地知道npx在Windows上如何找到java可执行文件 - 要么是$PATH或者$JAVA_HOME或者其他什么,我知道windows上PATH的一个常见错误是将它仅对当前用户设置(而不是系统级别),也许就是这种情况呢?

是否有任何shadow项目可以工作?也许你可以尝试一个更简单的。
问题在于变量已经在系统上设置,而不是针对当前用户。我将检查是否有其他的cljs项目运行,因为所有的配置看起来都相当完备。
明白了 - 手气不错

登录注册以回答此问题。

...