Sida loo socodsiiyo barnaamijka Java ee Command Prompt
Java waa mid ka mid ah luuqadaha inta badan la isticmaalo, loogana raadsado barnaamijyada barnaamijyada adduunka hadda. Waxaa loo adeegsadaa qaybo kala duwan sida injineernimada software, sayniska xogta, iwm. Si la mid ah luqadaha kale, koodka luqaddan waxaa lagu qoray IDE ( Integrated Development Environment ). Isticmaalayaasha qaar ayaa laga yaabaa, si kastaba ha ahaatee, inay door bidaan soo dejinta software dhinac saddexaad ah si ay kood ugu qoraan oo ay markaa door bidaan tifaftirayaasha qoraalka ku dhex jira sida Microsoft Word ama Notepad . Iyadoo kuwan laga yaabo inay kuu oggolaadaan inaad qorto koodka, kuma caawin karaan inaad socodsiiso. Halkani waa halka uu Talisku(Command Prompt) ku caawin karo. Maqaalkan, waxaan ku tusi doonaa sida aad u maamuli karto barnaamijka Java adigoo isticmaalayaDalab amar(Command Prompt) .
In kasta oo aan si gaar ah uga hadli doono Command Prompt , shaqadani waxay u jirtaa dhiggeeda macOS, Terminal , sidoo kale. Habka waa isku mid u Mac sida ay tahay for Windows . Shuruud ahaan, waxaa lagaaga baahan yahay inaad ku soo dejiso kombuyuutarkaaga Java -ga u go'ay. (Java)Waxaad ka soo dejisan kartaa Qalabka Horumarinta Java(Java Development Kit) ( JDK ), kaas oo ka socda dhammaan aaladaha sida agabka ugu muhiimsan ee lagu qoro koodka Java , laga bilaabo shabakadda (Java)Oracle . Waa in aad JDK soo dejiso oo lagu rakibaa kombayutarka ka hor inta aanad bilaabin hawsha.
Sida loo socodsiiyo barnaamijka Java iyadoo la isticmaalayo Command Prompt
Waxyaabaha ugu horreeya(First) marka hore, waa inaad qortaa koodka aad rabto inaad ku shaqeyso oo aad kaydiso faylka Java la fulin karo. (Java)Ujeedadaas awgeed, waxaad isticmaali kartaa MS Word ama Notepad midkood . Tusaale ahaan, waxaanu qori doonaa kood fudud oo bixiya soo saarista "Hello World!". Tani waa sida uu kood u ekaan lahaa:
public class HelloWorld { public static void main(String[] args) { System.out.println("Hello, World!"); } }
Isticmaalayaashu waa inay hubiyaan soo gelitaannada saxda ah mar haddii Notepad iyo (Notepad)Word midna aanu kaa caawinayn taas, iyo sidoo kale in faylka loo kaydiyay sidii faylka '.java' oo aan ahayn faylka '.txt'. Si taas loo sameeyo, u magacow faylkaaga 'Sample File .java' ( Waxaad magacaabi kartaa faylka wax kasta, ilaa inta faylka kordhintu uu yahay .java iyo nooca faylka(File) , dooro 'All File s'. Faylkan waa inuu ahaado lagu kaydiyay gal gooni ah oo ku yaal meeshaad rabto.
Hadda, fur Command Prompt oo u wad sidii maamule. Waxaan isticmaali doonaa amarka 'cd' si aan u bedelno hagaha hawlgalka ee Command Prompt midka lagu kaydiyo barnaamijkaaga Java . Ku socodsii khadka amarka ee soo socda:
cd Folder-destination[Java-program-folder]
Waxaad hubin kartaa haddii faylkaaga barnaamijka Java uu ku jiro buug-tusahaan adigoo isticmaalaya amarka Dir sidoo kale. Hadda, raadi jidka JDK ee kombiyuutarkaaga, oo deji dariiqa JDK adoo isticmaalaya khadka soo socda. Tusaale ahaan, haddii aad ku shaqaynayso nooca Windows ee 64-bit ah (maadaama ay taasi inta badan tahay kiiska), oo aad go'aansato inaad ku rakibto faylka 64-bit ee JDK , meesha aad galeyso waxay noqon doontaa "C: Program (JDK)Files\Java ", ilaa adiga go'aanso inaad bedesho inta lagu jiro rakibidda.
set path=%path%;C:\Program Files\Javajdk
Marka xigta, isticmaal amarka javac ( Java compile) si aad u ururiso barnaamijkaaga.
javac SampleFile.Java
Waa inaad raacdaa erayga muhiimka ah ee Java ka dib magaca faylka ee aad u dooratay barnaamijkaaga. Weli ma arki doontid wax dhacaya, maadaama barnaamijka la sameeyay oo kaliya oo aan weli socon. Ugu dambeyntii, si aad u socodsiiso amarka, isticmaal amarka Java .
java SampleFile
Haddii aad ururinayso barnaamijyo fudud oo aad dhammaan ku hayso buug isku mid ah, uma baahnid inaad waddo joogto ah u dejiso faylalkaaga, laakiin haddii kiisku yahay mid kale, markaa waxaad ku fiicnaan doontaa inaad sidaas samayso. Dareenka Amarka(Command Prompt) ayaa dejinaya doorsoomiyaha deegaanka ee fadhigaas, laakiin goobahaas waa la waayayaa marka aad xidhid Command Prompt(Command Prompt) oo fadhigaagu wakhtigu kaa dhamaaday. Haddaba, haddii aad rabto inaad waddo joogto ah u dejiso dhammaan fadhiyadaada mustaqbalka, waxaad raaci kartaa tillaabooyinka hoose:
Fur Control Panel oo booqo nidaamka(System) iyo ammaanka(Security) goobaha. Waxaad ku heli kartaa iyaga adoo eegaya goobaha Control Panel sida (Control Panel)Qaybta(Category) . Boggan waxa kale, oo kale, lagala xidhiidhi karaa goobaha Windows - ka sidoo kale. Dhinaca bidix ee shayga ikhtiyaariga ah, ka dooro Advanced System Settings oo(System) guji badhanka Bey'ada Variables(Environment Variables) ee xagga hoose ee sanduuqa Properties .
Hoosta Isbeddelka Nidaamka(System Variables) , waxaad ka heli doontaa doorsoomiyaha Waddada . (Path)Dooro taas oo guji Edit , oo ku taal midigta hoose.
In the Edit Environment Variable sanduuqa, guji New , kaas oo kuu ogolaanaya inaad ku darto hage cusub jidkaaga.
Halkan, ku dheji dariiqa aad isticmaashay korka marka aad ururinayso Javascript oo badbaadi Settings adigoo gujinaya OK.
Kuwani waa tillaabooyinka aad u baahan tahay inaad raacdo si aad u ururiso una socodsiiso barnaamijka Java adigoo isticmaalaya Command Prompt . Sida qoraal ahaan, isticmaalayaashu waa inay maskaxda ku hayaan inay isticmaalaan Qalabka Horumarinta Java(Java Development Kit) ee nidaamka oo aan ahayn Java Runtime Environment , taas oo ah wax laga yaabo in badan oo ka mid ah barnaamijyada Java , kuwaas oo akhrinaya maqaalkan, horeyba u rakibay oo ku shaqeeya kombuyuutarkooda.
Waxaad ka soo dejisan kartaa JDK Oracle.com . Waxaan rajeyneynaa in maqaalkani uu awooday inuu ku caawiyo.
Related posts
Sida loo soo celiyo Diiwaanka iyadoo la isticmaalayo Command Prompt gudaha Windows 11/10
Sida loo uninstall barnaamijka iyadoo la isticmaalayo Command Prompt in Windows 11/10
Hubi Windows 10 qaab dhismeedka OS adoo isticmaalaya PowerShell ama Command Prompt
Samee barta soo celinta nidaamka adoo isticmaalaya Command Prompt ama PowerShell
Sida loogu ciyaaro fiidiyowga VLC adoo isticmaalaya Command Prompt
Liiska CMD ama Command Prompt kiiboodhka gaaban ee gudaha Windows 11/10
Ogow goorta Windows la rakibay. Waa maxay taariikhda la rakibay ee asalka ah?
Qari ama qari qaybta Hard Drive-kaaga adoo isticmaalaya Command Prompt
Sida loo tafatiro Registry ka Command Prompt in Windows 10
Furaha TAB ee si otomaatig ah u dhammaystiran oo aan ku shaqayn Command Prompt
Sida loo dayactiro Microsoft 365 iyadoo la isticmaalayo Command Prompt gudaha Windows 11/10
Tirtir Faylka ama Faylka adigoo isticmaalaya Command Prompt (CMD)
Ku beddel PowerShell Command Prompt gudaha Menu Context gudaha Windows 10
Maamul shabakadaha Wireless-ka adoo isticmaalaya Command Prompt gudaha Windows 11/10
Beddel erayga sirta ah ee Koontada Maxalliga ah adigoo isticmaalaya Command Prompt ama PowerShell
Soo hel xogta Faylka iyo Lahaanshaha Faylka adigoo isticmaalaya Command Prompt
Sida loo furo Microsoft Store apps ka Command Prompt
Gal Serverka FTP adoo isticmaalaya Command Prompt gudaha Windows 10
Amarada waxtarka leh ee lagu maamulo faylalka iyo faylalka iyadoo la isticmaalayo Command Prompt
Daar Desktop Fog adoo isticmaalaya Command Prompt ama PowerShell