Jump to content

.jar Files

Hey guys i have the latest Java installed but when i try to open a .jar file it opens then immediately closes, I tried a complete reinstall of java but its not working, if you guys have any ideas it would be greatly apreciated

Link to comment
Share on other sites

Link to post
Share on other sites

specs? OS?

I live in misery USA. my timezone is central daylight time which is either UTC -5 or -4 because the government hates everyone.

into trains? here's the model railroad thread!

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, CrazySnake96 said:

Hey guys i have the latest Java installed but when i try to open a .jar file it opens then immediately closes, I tried a complete reinstall of java but its not working, if you guys have any ideas it would be greatly apreciated

How do you open them, are you trying to double-click? Have you tried something like this on the command line:

java -jar <filename.jar>

 

Remember to either quote or @mention others, so they are notified of your reply

Link to comment
Share on other sites

Link to post
Share on other sites

windows 10 pro
Ryzen 7 2700X
Aorus x470 gaming 5
16GB DDR4
RTX 2080 ROG STRIX

Link to comment
Share on other sites

Link to post
Share on other sites

try running as admin.

I live in misery USA. my timezone is central daylight time which is either UTC -5 or -4 because the government hates everyone.

into trains? here's the model railroad thread!

Link to comment
Share on other sites

Link to post
Share on other sites

Try running the jar-file from the command line. The command line window should stay open, so you can hopefully see what the issue is. For example, it's possible the Java-program was written for an older version of Java and is not compatible with the latest version.

Remember to either quote or @mention others, so they are notified of your reply

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, CrazySnake96 said:

image.png.1fe1bd5f4294b72c8c594edbce524711.png

Is the jar-file located in that directory? You may need to "cd" into that directory first before you do that.

Remember to either quote or @mention others, so they are notified of your reply

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, CrazySnake96 said:

no its located in my downloads folder

Well, then open the command line in that directory. Meaning, open command line, then

cd C:\Users\fater\Downloads

then try the java -jar command again.

Remember to either quote or @mention others, so they are notified of your reply

Link to comment
Share on other sites

Link to post
Share on other sites

ok update it works if i do it via cmd but why dosnt it work normally?

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, CrazySnake96 said:

ok update it works if i do it via cmd but why dosnt it work normally?

That is "normal" for a Java-app ;) You can't just double-click to start them, because Windows doesn't know what to do with it.

 

~edit: There is a way to get it to work with double-click, by teaching Windows what to do:

assoc .jar=jarfile
ftype jarfile="C:\path\to\your\java.exe" -jar "%1" %*

You need to enter these two commands on the command line, and replace "C:\path\to\your\java.exe" with the correct path to "java.exe"

Remember to either quote or @mention others, so they are notified of your reply

Link to comment
Share on other sites

Link to post
Share on other sites

4 hours ago, Eigenvektor said:

That is "normal" for a Java-app ;) You can't just double-click to start them, because Windows doesn't know what to do with it.

 

~edit: There is a way to get it to work with double-click, by teaching Windows what to do:


assoc .jar=jarfile
ftype jarfile="C:\path\to\your\java.exe" -jar "%1" %*

You need to enter these two commands on the command line, and replace "C:\path\to\your\java.exe" with the correct path to "java.exe"

you can, it works on my linux machine for jfx apps. You just need to set the default action for files with .jar extensions similar to how you set a default video player. 

Sudo make me a sandwich 

Link to comment
Share on other sites

Link to post
Share on other sites

5 hours ago, wasab said:

you can, it works on my linux machine for jfx apps. You just need to set the default action for files with .jar extensions similar to how you set a default video player. 

That's exactly what the "assoc" and "ftype" commands to, they set a default action for .jar files ;)

Remember to either quote or @mention others, so they are notified of your reply

Link to comment
Share on other sites

Link to post
Share on other sites

11 hours ago, CrazySnake96 said:

Hey guys i have the latest Java installed but when i try to open a .jar file it opens then immediately closes, I tried a complete reinstall of java but its not working, if you guys have any ideas it would be greatly apreciated

Jar files are Zip files. They're not executable binaries.

 

You either run them from the command line, or you create a shortcut that calls the JRE with the .JAR as a parameter.

 

"C:\path\to\javaw.exe" -jar "C:\path\to\jar\myExecutableJar.jar"

 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×