简体   繁体   English

无法运行过去正常工作的.jar文件

[英]Can't run a .jar file that used to work just fine

My problem is I can't run "file.jar parameters" from Windows console. 我的问题是我无法从Windows控制台运行“ file.jar参数”。 I used to be able to do just that. 我曾经能够做到这一点。

Now I have to use the "java -jar file.jar parameters" syntax to get it to work - otherwise I just get "'could not load main class" error. 现在,我必须使用“ java -jar file.jar parameters”语法来使其正常工作-否则,我只会收到“无法加载主类”错误。 I've changed path variables, reinstalled java etc. and it only made it messier. 我已经更改了路径变量,重新安装了Java等,它只会使它更混乱。

How do I return to the point where I can just write file.jar in the console and make it run? 我该如何回到可以在控制台中写入file.jar并使其运行的地步? I HAVE to be able to do this because I call this script from PHP shell and for whatever funky reason the shell doesn't work when I call it via the "java -jar file.jar parameters" syntax - but it used to work with the "file.jar parameters" syntax. 我之所以能够做到这一点,是因为我是从PHP Shell调用此脚本的,而出于种种奇怪的原因,当我通过“ java -jar file.jar parameters”语法调用该Shell时,外壳无法工作-但它以前可以与“ file.jar参数”语法。

I hate java it's a mess and i have multiple lib folders, some trash from previous installations it's a disaster and i am raging after trying to fix it for the last 6 hours... somebody please help me i am near throwing the computer through the window 我讨厌java,这是一个烂摊子,我有多个lib文件夹,以前安装时有些垃圾,这是一场灾难,在尝试修复了最近6个小时后,我非常愤怒...有人请帮我,我快把计算机扔掉了窗口

您可以只创建一个内容为“ java -jar file.jar”的.bat文件,然后您的PHP shell可以直接执行bat

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM