使用JAVA或MVN命令在Linux命令行中运行时,使用Eclipse在windows中运行CAMEL-JAR文件时出现的问题

使用JAVA或MVN命令在Linux命令行中运行时,使用Eclipse在windows中运行CAMEL-JAR文件时出现的问题,jar,apache-camel,Jar,Apache Camel,它成功地运行了,还构建了Jar文件并从命令提示符下运行它 它正在按要求运行。但是当我把JAR文件移到我们的Linux机器上时 这就像一个作业管理器服务器,当我尝试运行JAR文件时,如下所示 我收到下面的错误消息 I have built a Camel project in Eclipse with Maven dependencies. 已缓存在本地存储库中,在经过central的更新间隔或强制更新之前,不会重新尝试解析。原始错误:无法将元数据org.codehaus.mojo/maven

它成功地运行了,还构建了Jar文件并从命令提示符下运行它 它正在按要求运行。但是当我把JAR文件移到我们的Linux机器上时 这就像一个作业管理器服务器,当我尝试运行JAR文件时,如下所示 我收到下面的错误消息

I have built a Camel project in Eclipse with Maven dependencies. 
已缓存在本地存储库中,在经过central的更新间隔或强制更新之前,不会重新尝试解析。原始错误:无法将元数据org.codehaus.mojo/maven-metadata.xml从/传输到中心():proxy.host.net

When I try to run with the below command

$ java –jar mycamelproject

I am getting the below error, but I do have the below mentioned dependency in the Dependency-Jars folder.

Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/c
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Class.java:2531)
        at java.lang.Class.getMethod0(Class.java:2774)
        at java.lang.Class.getMethod(Class.java:1663)
        at sun.launcher.LauncherHelper.getMainMethod(LauncherHelper.java:494)
        at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:486)
Caused by: java.lang.ClassNotFoundException: org.springframework.context.support
        at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
        ... 6 more
Then I tried running with the below command.

$ mvn -X exec:java -Dexec.mainClass=mycamelpackage.mycamelmainclass         

I am getting a series of the below errors such as below

    [DEBUG] Could not find metadata org.codehaus.mojo/maven-metadata.xml in local (/home/ec2-user/.m2/repository)

[DEBUG] Skipped remote update check for org.codehaus.mojo/maven-metadata.xml, already updated during this session.

[WARNING] Failure to transfer org.codehaus.mojo/maven-metadata.xml from 
插件组[org.apache.maven.plugins,org.codehaus.mojo]
可从存储库中获得

如果未设置类路径,
java–jar mycamelproject
应该如何工作?而且
mycamelproject
无论如何都应该是一个JAR文件(如果是,您应该添加
*.JAR
扩展名)


除此之外,我猜您的本地Maven存储库可能已损坏。这通常就是您看到
解析不会被重新尝试的原因
错误消息。修复此问题的最简单方法是删除损坏的目录,然后再次启动Maven。

感谢您的回复peter..已将其排序..正如您提到的,我在执行时一直在命令行中使用.jar….实际问题是,在运行.jar文件时,未拾取依赖项jar。我已经将dependency jars文件夹复制到了可执行jar所在的同一个文件夹中,并运行了它,它解决了这个问题。。。。
[ERROR] No plugin found for prefix 'exec' in the current project