crontab執行jar包時,Could not find or load main class(找不到或者載入不到主類)
crontab執行jar包時,Could not find or load main class(找不到或者載入不到主類)
在linux伺服器上配置crontab時,子賬戶執行不報錯,但是切到root賬戶,配置同樣crontab和feature_redis.sh會報錯,具體原因不明
在jar包目錄下有指令碼檔案feature_redis.sh,指令碼內容如下
#!/bin/bash
source /etc/profile
java -cp xxxx-1.0-SNAPSHOT-jar-with-dependencies.jar com.xxxx.recommend.rank.redis.FeatureRedis $1 > /home/reco/workspace/model_train/datajar/log_redis.txt 2>&1 &
然後在crontab裡配置
0 9 * * * sh /home/reco/workspace/model_train/datajar/feature_redis.sh `date -d "1 days ago" +\%F` 會報找不到或者載入不到主類
修改為 0 9 * * * cd /home/reco/workspace/model_train/datajar && sh feature_redis.sh `date -d "1 days ago" +\%F` 可正確執行
相關文章
- jar檔案could not find the main class解決JARAI
- java編譯 Error: Could not find or load main class java執行包main方法Java編譯ErrorAI
- swing程式打成jar包,執行出現(could not find the main class)問題,請高手指點!!JARAI
- 執行.class檔案提示找不到或者無法載入主類原因
- Could not find the main class. Program will exitAI
- Idea打包springboot專案jar包,執行報找不到主清單屬性或找不到主類問題解決方法。IdeaSpring BootJAR
- spark-submit執行jar包報錯找不到類的解決方法SparkMITJAR
- idea執行專案報錯找不到jar包IdeaJAR
- 匯入jar包,main函式JARAI函式
- android studio導jar包找不到類的解決方法AndroidJAR
- Jar 包執行時修改配置JAR
- Idea 匯入module後,程式碼中jar包找不到引用IdeaJAR
- IDEA——錯誤: 找不到或無法載入主類 com.MainIdeaAI
- J2SE - Could not find the main class: xxx.xxx.Program will exitAI
- Eclipse打JAR包引用的第三方JAR包找不到的問題。EclipseJAR
- Could not find jar tool executable問題解決JAR
- 啟動Hbase Shell失敗——找不到或無法載入主類org.jruby.MainAI
- 安裝JDK不當--找不到或無法載入主類 com.sun.tools.javac.MainJDKJavaAI
- Java 熱載入jar包JavaJAR
- jar命令打包與java執行jar包JARJava
- 修改jar包內的classJAR
- sun.misc.BASE64Encoder找不到jar包的解決方法JAR
- java URLClassLoader 載入外部jar包中的指定的類JavaJAR
- idea找不到或無法載入主類Idea
- 錯誤: 找不到或無法載入主類
- java 生成可執行jar包JavaJAR
- jar包中匯入新的類JAR
- Could not load file or assembly 'System.ServiceModel.DomainServices.Hosting'.系統找不到指定檔案AI
- 命令列執行python時找不到模組怎麼解決命令列Python
- Linux jar包 後臺執行LinuxJAR
- 找不到 main 方法, 請將 main 方法定義為: public static void main(String[] args)AI
- 請教:castor MappingException: Could not find the class異常ASTAPPException
- This application failed to start because it could not find or load the Qt platform plugin “windows“APPAIQTPlatformPluginWindows
- Application failed to start because it could not find or load the QT platform plugin “windows”APPAIQTPlatformPluginWindows
- 更改jar包中的一個classJAR
- IDEA本地執行hadoop程式成功,叢集執行找不到自定義的Mapper類IdeaHadoopAPP
- Springboot 修改包名之後,報"錯誤: 找不到或無法載入主類"Spring Boot
- JVM程式用一個主執行緒來執行main()方法JVM執行緒AI