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

欢迎!请查看 关于 页面以了解更多关于如何使用本网站的信息。

0
编译器

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

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

系统路径上找不到可执行 '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 位服务器 VM (构建 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的一个常见错误是只为当前用户设置(而不是全局系统), maybe it's something like that?

shadow项目是否可以运行?也许尝试一个更简单一点的项目。
问题在于这个变量是在系统层面设置的,而不是当前用户,我将要检查是否有其他cljs项目能够运行,因为所有配置看起来都相当完备。
你得到了 —— 祝你好运

登录注册以回答此问题。

...