Menu

No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

If you are getting error "No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?" while compiling any java application either using Eclipse, NetBeans and any other IDE, the simple meaning of this error is; you are trying to compile your Java program using JRE which is not possible. To compile any Java program we need JDK.

There could be two reasons which causing this error. Will see both the ways to fix this issue.

How to check installed version of Java in your machine.

1. If you don't have JDK installed in your machine/Computer.

  • To resolve this you need to download the latest version of JDK and install it in your machine. 
  • Then setup environment  variable and path. for more check here.


2. If JDK is already installed in your machine but installed JRE path is not setup to JDK path. 

  • Open eclipse
  • Go to Window > Preferences > Java > Installed JREs > and check your installed JREs.
  • There should be a entry available for JDK in installed JRE. In case there is no JDK entry then you have to add path of installed JDK from your machine.

To do this:
  • Go to C drive of your computer and find the directory of JDK in program files. e. g. C:\Program Files\Java\jdk1.8.0_111 
  • Copy this path and add this path in your installed JREs option in your IDE.
inatalled JRE in eclipse
Inatalled JRE in eclipse
  •  Click on Add button from right side of window. A new window will appear, click on standard VM > Next > In JRE home section put the path of installed JDK from program files and click on finish.
JRE defination window
JRE defination window

  • After doing these all JDK will be appear in your installed JREs window. From there you mark/check JDK and apply.
inatalled JRE in eclipse
Inatalled JRE in eclipse

    How to check installed Java version in your machine?

    If you see this error while executing any program or running and debugging maven build then follow the following easy steps, to resolve this issue from eclipse.


    How to check installed Java version in your machine?

    There are two ways to check installed java version in your machine.
    1. Using command prompt
    • Go to start and search for cmd, open command prompt.
    • No need to change the default directory from command prompt, just  copy and paste command "java -version".
    • Hit enter key to run the command.

    Below is the screen shot for more clarification.


    how to check java version
    Java version check

    2. Another simple way to check installed java version in your machine by using java version link.


    Verify version of java installed in your machine
    Verify Java and find out-dated version



    • Click on the Agree and continue button.
    • A popup window will appear, which needs your approval to run java version check application. Simply click on the "Run" button on that popup.
    • Now you will see the Java detail page on your browser. as showing in the below screen shot.

    Java version in your machine
    Java version in your computer

    Ghar nari gawari, chaahe jo kahe | घर नारी गवरी, चाहे जो कहे

    Preetam desh suhawano, jahan basen dildaar 
    Khusro...
    Wahoo desh pe, so tan man deejo waar

    Ghat ke andar baith ke, or kare premi se pyar
    Aise piya pe chupchap, na tan man deejo waar

    Ghar nari gawari, chaahe jo kahe
    Main Nijam se naina laga aaii re

    Khusro rain suhag ki, so jagi pii ke sang
    Tan mora, man piihuu kaa, so dono aik hi rang

    Aisa sundar, aisa chhabeela, duja koi nahin
    Jaisa Baba Farid ka pyara Khwaja Nijamuddin

    Aao sakhyon sab mil baithen, peer nijam ke sang 
    ek pal me jo, nain mila kar, range prem ke rang 

    Ghar nari gawari, chaahe jo kahe
    Main Nijam se naina laga aaii re

    Khusro sagda jug bhar dhunde, nagri nagri jaye
    Tohra piya, tere sang rahat hai, tu kahe ghabraye

    Sohani soorat, mohani moorat,
    Mein to hirday beech samaa aaii re

    Ghar nari gawari, chaahe jo kahe
    Main Nijam se naina laga aaii re

    Maraa tana mazam, aay muddaye, tarze adayam dee
    Manam rindey, kharabaaty, sare bazaar me raqsam

    Ghar nari gawari, chaahe jo kahe
    Main Nijam se naina laga aaii re

    Khusrao Nijam ke bal bal jayye,
    Mein to anmol cheri bita aaii re

    Ghar nari gawari, chaahe jo kahe
    Main Nijam se naina laga aaii re


    --@ Ameer Khusro

    =================================================================

    प्रीतम देश सुहावनो, जहाँ बसें दिलदार 
    खुसरो ...
    वहू देश पे, सो तन मन दीजो वार 

    घाट के अंदर बैठ के, और करे प्रेमी से प्यार 
    ऐसे पिया पे चुपचाप, न तन मन दीजो वार 

    घर नारी गवरी, चाहे जो कहे 
    मैं निजाम से नैना लगा आई रे 

    खुसरो रेन सुहाग की, सो जगी पी के संग 
    तन मोरा, मन पीहू का, सो दोनों एक ही रंग

    घर नारी गवरी, चाहे जो कहे 
    मैं निजाम से नैना लगा आई रे 

    ऐसा सुन्दर, ऐसा छबीला, दूजा कोई नहीं 
    जैसा बाबा फरीद का प्यारा ख्वाजा निजामुद्दीन

    आओ साख्यों सब मिल बैठें, पीर निजाम के संग 
    एक पल में जो, नैन मिला कर, रेंज प्रेम के रंग 

    घर नारी गवरी, चाहे जो कहे 
    मैं निजाम से नैना लगा आई रे 

    खुसरो सगड़ा जग भर ढूंढे, नगरी नगरी जाये 
    तोहरा पिया, तेरे संग रहत है, तू कहे घबराये 

    सोहनी सूरत, मोहनी मूरत,
    में तो ह्रदय बीच समा आई रे 

    घर नारी गवरी, चाहे जो कहे 
    मैं निजाम से नैना लगा आई रे 

    मरा तना मज़म, ए मुद्दई, तर्ज़े अदायम दी 
    मनम रिंदे, ख़राबाटी, सरे बाजार में रअक़्सम 

    खुसरो निजाम के बल बल जाइये,
    में तो अनमोल चेरी बिता आई रे 

    घर नारी गवरी, चाहे जो कहे 
    मैं निजाम से नैना लगा आई रे 

    -- @अमीर खुसरो