DEV Community

PHAGUN JAIN
PHAGUN JAIN

Posted on

2

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!

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (3)

Collapse
 
michelemauro profile image
michelemauro

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

Collapse
 
phagunjain profile image
PHAGUN JAIN

Thank you for suggestion sir

Collapse
 
akshatgoyal1018 profile image
AkshatGoyal

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

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay