Jump to content

Can't get Java File(s) to execute

Go to solution Solved by PorkishPig,
9 minutes ago, Zeredos said:

Same result, just an open blank cmd window.

Try using Jarfix from https://johann.loefflmann.net/en/software/jarfix/index.html.

Hello, i built my first PC about 2 weeks ago now, all has been smooth sailing so far until i have noticed that when trying to install Minecraft Forge i cannot get the file to work properly. When i try to execute it i just get a quick load wheel on my cursor then nothing. I have done several troubleshooting steps of my own from doing some research such as:

1. Setting the correct path to the folder in Environment Variables in This PC
2. Reinstalled both JRE and JDK (separately)
3. Making a separate .bat file with the Java file to see if it'd run and all i got was the cmd.exe doing this: image.png.ab4f68fb32d541acf476a567042a0635.png

I moved on from a laptop and i naturally never had any issues regarding Java ever, so with finally building a PC and experiencing it this is definitely all new to me, i appreciate all your help and time.

Link to comment
https://linustechtips.com/topic/1342267-cant-get-java-files-to-execute/
Share on other sites

Link to post
Share on other sites

Try adding "-verbose" to see if you get more enlightening information.

Crystal: CPU: i7 7700K | Motherboard: Asus ROG Strix Z270F | RAM: GSkill 16 GB@3200MHz | GPU: Nvidia GTX 1080 Ti FE | Case: Corsair Crystal 570X (black) | PSU: EVGA Supernova G2 1000W | Monitor: Asus VG248QE 24"

Laptop: Dell XPS 13 9370 | CPU: i5 10510U | RAM: 16 GB

Server: CPU: i5 4690k | RAM: 16 GB | Case: Corsair Graphite 760T White | Storage: 19 TB

Link to post
Share on other sites

Does double clicking on the program like its a exe not work?

I could use some help with this!

please, pm me if you would like to contribute to my gpu bios database (includes overclocking bios, stock bios, and upgrades to gpus via modding)

Bios database

My beautiful, but not that powerful, main PC:

prior build:

Spoiler

 

 

Link to post
Share on other sites

1 hour ago, tikker said:

Try adding "-verbose" to see if you get more enlightening information.

Sorry for the late reply, could you specify on where to put it? i tried at the end and after -jar and nothing happened other than showing "-verbose" in the cmd window, sorry for a most likely obvious question.image.png.b7eddd7912e5f6f158a9fc057d5939b4.png

Link to post
Share on other sites

8 minutes ago, Zeredos said:

Sorry for the late reply, could you specify on where to put it? i tried at the end and after -jar and nothing happened other than showing "-verbose" in the cmd window, sorry for a most likely obvious question

I'm pretty sure for a bat file it would need to start with

@ECHO OFF

And have the jar execution command on the next line

I could use some help with this!

please, pm me if you would like to contribute to my gpu bios database (includes overclocking bios, stock bios, and upgrades to gpus via modding)

Bios database

My beautiful, but not that powerful, main PC:

prior build:

Spoiler

 

 

Link to post
Share on other sites

Try putting the whole command in quotation marks.  Oddly enough, that has worked for me with this exact issue in the past. 

If I have to explain every detail, I won't talk to you.  If you answer a question with what can be found through 10 seconds of googling, you've contributed nothing, as I assure you I've already considered it.

 

What a world we would be living in if I had to post several paragraphs every time I ask a question.

Link to post
Share on other sites

8 minutes ago, Yuri Fury said:

Try putting the whole command in quotation marks.  Oddly enough, that has worked for me with this exact issue in the past. 

Gave it a whirl and all i got was it quickly showing an open window on the taskbar and quickly disappearing, nothing even shows up on the desktop. Just to 100% make sure, you're referring to doing it like this correct? image.png.b39bb9193c9a520d8f3428eb1fdd6737.png

Link to post
Share on other sites

That's more or less what I was thinking, although I give the full path to 'java' as "C:\Program Files\.......\java -jar [etc etc]"

If I have to explain every detail, I won't talk to you.  If you answer a question with what can be found through 10 seconds of googling, you've contributed nothing, as I assure you I've already considered it.

 

What a world we would be living in if I had to post several paragraphs every time I ask a question.

Link to post
Share on other sites

11 minutes ago, Yuri Fury said:

That's more or less what I was thinking, although I give the full path to 'java' as "C:\Program Files\.......\java -jar [etc etc]"

Yeah, ibieve on windows you do have to give the path. 

On Linux all you need is to be in the directory of the file and run

sudo java -jar [filename].jar

Which is all he is doing.

But on windows you might need to specify the Java location. 

Or drag the jarfile onto the Java.exe program

I could use some help with this!

please, pm me if you would like to contribute to my gpu bios database (includes overclocking bios, stock bios, and upgrades to gpus via modding)

Bios database

My beautiful, but not that powerful, main PC:

prior build:

Spoiler

 

 

Link to post
Share on other sites

2 minutes ago, HelpfulTechWizard said:

Yeah, ibieve on windows you do have to give the path. 

On Linux all you need is to be in the directory of the file and run


sudo java -jar [filename].jar

Which is all he is doing.

But on windows you might need to specify the Java location. 

Or drag the jarfile onto the Java.exe program

Nothing with dragging either, cmd.exe window pops up for a split second then poofs, brain is quite rattled at this point lol.

Link to post
Share on other sites

To make sure you have the JDK property installed and in your path, you can open powershell and run java -version and javac -version and see if the versions match. If not, uninstall everything with java in the name an reinstall your JDK from https://www.oracle.com/java/technologies/javase-jdk16-downloads.html. Test your java install with your forge installer again, or if that doesn't work use something known to work like Minecraft Server to test.

Edited by piestormer
Unclear wording
Link to post
Share on other sites

10 minutes ago, piestormer said:

To make sure you have the JDK property installed and in your path, you can open powershell and run java -version and javac -version and see if the versions match. If not, uninstall everything with java in the name an reinstall your JDK from https://www.oracle.com/java/technologies/javase-jdk16-downloads.html. Test your java install with your forge installer again, or if that doesn't work use something known to work like Minecraft Server to test.

image.png.41dfdb4068bbd7c2a95f0686639b7c7b.png
Everything appears to be the same version, not sure on the additional numbers up top though.

Link to post
Share on other sites

56 minutes ago, piestormer said:

Yeah that seems fine. Any luck with Minecraft Server? It's possible that your forge is just garbage (oh, and use powershell to test - I really don't trust CMD to work the way I'd expect it to)

Well i've made sure to test with multiple versions of Forge and i get the same results if that means anything, as for the server could you tell me how to do that?

Link to post
Share on other sites

Oh, I was just suggesting Minecraft Server as good known working java code to run - but any other known good java program would equally work. If I remember correctly Minecraft will tell you what version of java the game Is running in if you press f3 in game - if the java version number in the top right is 16.0.1 then it's working and running

 

Edit: my memory is not correct Minecraft uses it's own imbedded java now. Good luck op, forge is always a pain in the ass

Edited by piestormer
My memory is not correct
Link to post
Share on other sites

35 minutes ago, piestormer said:

Oh, I was just suggesting Minecraft Server as good known working java code to run - but any other known good java program would equally work. If I remember correctly Minecraft will tell you what version of java the game Is running in if you press f3 in game - if the java version number in the top right is 16.0.1 then it's working and running

Ah ok, well i hopped on the game and found that the java ver. is 1.8.0_51 apparently. But i am still unsure on what that means, is that the root cause of this? i am pretty stumped at this point.

Link to post
Share on other sites

11 hours ago, Zeredos said:

Sorry for the late reply, could you specify on where to put it? i tried at the end and after -jar and nothing happened other than showing "-verbose" in the cmd window, sorry for a most likely obvious question.image.png.b7eddd7912e5f6f158a9fc057d5939b4.png

Maybe "java -verbose -jar <jarfile>"? -jar might expect the jar file as the immediate next argument.

Crystal: CPU: i7 7700K | Motherboard: Asus ROG Strix Z270F | RAM: GSkill 16 GB@3200MHz | GPU: Nvidia GTX 1080 Ti FE | Case: Corsair Crystal 570X (black) | PSU: EVGA Supernova G2 1000W | Monitor: Asus VG248QE 24"

Laptop: Dell XPS 13 9370 | CPU: i5 10510U | RAM: 16 GB

Server: CPU: i5 4690k | RAM: 16 GB | Case: Corsair Graphite 760T White | Storage: 19 TB

Link to post
Share on other sites

52 minutes ago, Zeredos said:

No luck, just opens cmd.exe blank.

No output at all in the powershell/cmd window where you ran that command? Hmm. No idea then. It's been a long time since I dealth with Minecraft jar-shenenigans.

Crystal: CPU: i7 7700K | Motherboard: Asus ROG Strix Z270F | RAM: GSkill 16 GB@3200MHz | GPU: Nvidia GTX 1080 Ti FE | Case: Corsair Crystal 570X (black) | PSU: EVGA Supernova G2 1000W | Monitor: Asus VG248QE 24"

Laptop: Dell XPS 13 9370 | CPU: i5 10510U | RAM: 16 GB

Server: CPU: i5 4690k | RAM: 16 GB | Case: Corsair Graphite 760T White | Storage: 19 TB

Link to post
Share on other sites

23 minutes ago, tikker said:

No output at all in the powershell/cmd window where you ran that command? Hmm. No idea then. It's been a long time since I dealth with Minecraft jar-shenenigans.

If i remove "@ECHO OFF" it will loop like it did originally except show "-verbose" in the command line, but no additional information is given. Otherwise yep, just opens it essentially as if waiting for you to type.

Link to post
Share on other sites

Have you tried one of these methods (specifically method 5 and 6)?

And now a word from our sponsor: 💩

ℑ𝔣 𝔶𝔬𝔲 𝔬𝔫𝔩𝔶 𝔫𝔬𝔱𝔦𝔠𝔢 𝔭𝔢𝔯𝔣𝔬𝔯𝔪𝔞𝔫𝔠𝔢 𝔭𝔯𝔬𝔟𝔩𝔢𝔪𝔰 𝔴𝔥𝔢𝔫 𝔶𝔬𝔲 𝔥𝔞𝔳𝔢 𝔞 𝔰𝔱𝔞𝔱 𝔠𝔬𝔲𝔫𝔱𝔢𝔯 𝔬𝔳𝔢𝔯𝔩𝔞𝔶 𝔞𝔠𝔱𝔦𝔳𝔢, 𝔶𝔬𝔲 𝔞𝔯𝔢 𝔪𝔢𝔯𝔢𝔩𝔶 𝔩𝔬𝔬𝔨𝔦𝔫𝔤 𝔣𝔬𝔯 𝔭𝔯𝔬𝔟𝔩𝔢𝔪𝔰 𝔱𝔬 𝔟𝔢 𝔲𝔭𝔰𝔢𝔱 𝔬𝔳𝔢𝔯. 𝔗𝔲𝔯𝔫 𝔬𝔣𝔣 𝔱𝔥𝔢 𝔠𝔬𝔲𝔫𝔱𝔢𝔯 𝔟𝔢𝔣𝔬𝔯𝔢 𝔞𝔰𝔨𝔦𝔫𝔤 𝔣𝔬𝔯 𝔥𝔢𝔩𝔭 𝔞𝔫𝔡 𝔰𝔢𝔢 𝔦𝔣 𝔶𝔬𝔲 𝔰𝔱𝔦𝔩𝔩 𝔫𝔬𝔱𝔦𝔠𝔢.

-.-. --- --- .-.. --..-- / -.-- --- ..- / -.- -. --- .-- / -- --- .-. ... . / -.-. --- -.. .

ᑐᑌᑐᑢ

Spoiler

    ▄██████                                                      ▄██▀

  ▄█▀   ███                                                      ██

▄██     ███                                                      ██

███   ▄████  ▄█▀  ▀██▄    ▄████▄     ▄████▄     ▄████▄     ▄████▄██   ▄████▄

███████████ ███     ███ ▄██▀ ▀███▄ ▄██▀ ▀███▄ ▄██▀ ▀███▄ ▄██▀ ▀████ ▄██▀ ▀███▄

████▀   ███ ▀██▄   ▄██▀ ███    ███ ███        ███    ███ ███    ███ ███    ███

 ██▄    ███ ▄ ▀██▄██▀    ███▄ ▄██   ███▄ ▄██   ███▄ ▄███  ███▄ ▄███▄ ███▄ ▄██

  ▀█▄    ▀█ ██▄ ▀█▀     ▄ ▀████▀     ▀████▀     ▀████▀▀██▄ ▀████▀▀██▄ ▀████▀

       ▄█ ▄▄      ▄█▄  █▀            █▄                   ▄██  ▄▀

       ▀  ██      ███                ██                    ▄█

          ██      ███   ▄   ▄████▄   ██▄████▄     ▄████▄   ██   ▄

          ██      ███ ▄██ ▄██▀ ▀███▄ ███▀ ▀███▄ ▄██▀ ▀███▄ ██ ▄██

          ██     ███▀  ▄█ ███    ███ ███    ███ ███    ███ ██  ▄█

        █▄██  ▄▄██▀    ██  ███▄ ▄███▄ ███▄ ▄██   ███▄ ▄██  ██  ██

        ▀███████▀    ▄████▄ ▀████▀▀██▄ ▀████▀     ▀████▀ ▄█████████▄

 

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

×