Java Minecraft cmd server mix-up?

A while back I tried to set up a Minecraft server, not using Mojang's application. Sadly, this really screwed over my system and it doesn't allow me to operate the game anymore.

"Launchj4"
"The registry refers to a non-existant Java Runtime Environment installation or the runtime is corrupted.

The system can't find the path specified."

What I DO know is that I had to jump through a bunch of hoops to try and get it to work months back, before it stopped working.

I used Command Prompt to change the Java to run in a folder called "Server". When the server was too terrible and the lag unbearable with just me on it, I deleted it.

The problem is, I DON'T KNOW HOW TO CHANGE IT BACK so that it chooses the ACTUAL JAVA FOLDER instead of the ONE THAT DOESN'T EXIST ANYMORE.

Added (1). No, I just used Command Prompt to make it use Java but from a different location than the default folder it's in automatically. But, my problem is I don't know how to make it do the opposite.

Added (2). Deadpool, I'm not trying to start a server. I'm trying to make JAVA work.

Well you might want to contact a professorial about that thats weird and i have a degree in computer engineering and programming and that sounds completely insane it could have been a virus that attacked your computer when you ran the server thats why you never run something without a quick scan first for viruse and what i think it is a worm viruse most likely hoped this helps

Delete minecraft… Back-up any worlds you have, use the offical mojang app to make a server, re-download minecraft…