DEV Community


Posted on

How to setup java in windows 10

Recently i was installing JDK on my system, and i did everything from downloading jdk, jre and setting environment variables but when i went to run java code with the command "java MyProg" Error occurred saying something like "JNI error check your installation and try again" so I went on some online research and below is what i found: -->

JRE(JAVA Runtime Environment):it provides us with minimum stuff required for execution of java application/program, NOTE that it is helpful only in execution, We cannot compile or create byte code with it for that you need jdk.

JDK(JAVA Development Kit): it provides us with everything we need for developing java applications/programs, using jdk we can create byte code as it contains javac
during the online surfing I also came to know that for the versions of jdk older than jdk-11 we used to have JRE folder separately but in JDK-11 we don't need that as JRE is the part of JDK-11 link to source
also before doing anything understand the need means, if you are a developer who writes code you need to have compiler, runtime environment and other stuff but if you are a client or just want to run certain application then only thing you require is JRE that's it source

so if you want to install jdk

  1. goto this website.
  2. download the JDK
  3. unzip the folder in downloads
  4. setup the environment variable
  5. enjoy : )

Here is the step-by-step guide.

i struggled with this for two days so i thought it is worth sharing!

Top comments (3)

michelemauro profile image

I suggest you to try the Chocolatey package manager. It makes installing, updating and keeping up-to-date your tools way easier.

phagunjain profile image

Thank you for suggestion sir

akshatgoyal1018 profile image

Nice Job Brother!! It was very helpful. :)