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

欢迎!请参阅关于页面获取更多有关此如何工作的小信息。

0 投票
编译器

大家好,我基本上正在尝试使用一个 shadow 文件运行一个 Clojure 脚本应用程序,老实说我对 Clojure 了解并不多,因为这个项目是别人下载给我的,但我需要它在 Windows 11 上本地运行,而我接收到以下错误

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

系统路径中未找到可执行的 'java' 命令。

当然,我的系统中有 Java,我的环境变量也配置得很好,所以我认为问题可能出在 shadow 文件内部,但我无法确定是哪里,如果您能帮助我解决这个问题,将非常 helpful

下面是 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项目可以运行,因为配置似乎一切都很好
明白了 - 祝你好运

登录注册来回答这个问题。

...