What causes Unable to access jarfile error?
Fixed
I just placed it in a different folder and it worked.
What causes Unable to access jarfile error?
Fixed
I just placed it in a different folder and it worked.
Error unable to access jarfile C:\Jar
That's because of the space you have in the path name. On Windows, use quotes:
java -jar "C:\Jar Folder\P2.jar"
Python, unable to access jarfile using os.system()
Resolved:
Maybe this is obvious for a lot of people but I'll write what worked for me to help people with the same issue.
Let's say whe have this folder structure:
folder\start.py #is the python starter
folder\server\server.jar #is the server jar
folder\server\start.bat #is the server jar starter (java -Xmx1500M -Xms125M -jar server.jar nogui)
When with python you call os.system('server\\start.bat')
it opens a new console which led me thinking it was the start.bat cmd
, it is not, in fact python executing your batch commands in the folder
directory.
There are two methods I found to resolve this issue and both of them are not really convinient (I guess I'll make a python function to automate the process):
Option one: change the start.bat
file to java -Xmx1500M -Xms125M -jar server\server.jar nogui
Option two: change the start.bat
adding cd server
before the first line.
Related Topics
How to Have 2 Jvms Talk to One Another
How to Run Testng from Command Line
Is There a Good Natural Language Processing Library
Why Were Applets Deprecated in Jdk 9
How to Get a Date Without Time in Java
Difference Between @JSONignore and @JSONbackreference, @JSONmanagedreference
How to Do Arithmetic Operations on the Number Baseclass
In Java, What Are the Advantages of Streams Over Loops
Best Way to Represent a Fraction in Java
Class Has Been Compiled by a More Recent Version of the Java Environment
Executing Another Application from Java
How to Go About Formatting 1200 to 1.2K in Java
Getting Java Version at Runtime
How to Set the System Time in Java
How Do Shift Operators Work in Java
How to Connect to SQL Server Using Windows Authentication from Java Ee Webapp