Reply
Old 05-29-2014, 06:05 AM   #1 (permalink)
 
Status: Junior Member
Posts: 5



Default run java programs from desktop

Sorry, but Im new to this language, this morning I survived installing jdk and running java program of simple *hello world!* and im fully beginner and know nothing about java..
So please kindly help me how to run .java files in cmd
Should I write my java(notepad files) in installation directory?
I wrote a simple addition of 2 numbers program and saved it over desktop..
then i compiled in cmd using "javac sum.java"
It says:- javac : file not found: sum.java
?? help me please
I want to run as many codes and improve my logic..

sahilkumar is offline   Reply With Quote
Old 05-29-2014, 06:05 AM   #2 (permalink)
 
Status: Senior Member
Posts: 719



Default run java programs from desktop

You need to run `javac` in the directory containing your Java file. Use the command `cd Desktop` to change to the Desktop (assuming you are in your user profile directory).
Check that you are in the right directory using the `dir` command (which by default lists the contents of the current directory). If you see `sum.java` in the output, you are good to go.
Money07 is offline   Reply With Quote
more..
Old 05-29-2014, 06:05 AM   #3 (permalink)
 
Status: Junior Member
Posts: 2



Default run java programs from desktop

First of all you need to download and install both Java and JDK on your computer. If you want to run Java programs using the command prompt then you need to make some changes to your computer.
After installing java and JDK go to the JDK folder in C drive and there will be a folder called bin,
2. copy the link and get back to your desktop
3. Open computer properties and tap Advance Settinsg
4. then go for Environment variables
5. then type path(just double click it will allow you to edit. paste the link you copied followed by a semicolon).
Save it and try to run the program again
Galvin is offline   Reply With Quote

Reply

Bookmarks

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
im a java programmer i made a java software and i create the exe of it but when i run the exe in my desktop co? nayoma Computer Programmer 2 07-12-2013 06:06 PM
Do programs run faster on Windows 8 "desktop mode" than on Windows 7 desktop? MrPCUser Programming 3 01-19-2013 07:06 AM
Computer programs: Today Java is reporting security risks> Shall I delete all Java programs? Dougieboy Computer Programming 1 01-12-2013 07:06 PM
POL: What programs are on your desktop right now? Unknown_User Programming 0 07-22-2012 01:06 PM
Bought a new HP desktop. Wonder if I should delete all these HP programs that came with the desktop ! LivaUniomia Computer Programming 2 09-15-2011 10:36 AM