How do I run my code on pc? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How do I run my code on pc?

How do I go about running my code on my pc? I saved it as a .java file, and I changed to my desktop directory in my cmd. What do I do now?

14th Dec 2018, 2:21 AM
Dustin James Locey
Dustin James Locey - avatar
14 Answers
14th Dec 2018, 2:33 AM
Lambda_Driver
Lambda_Driver - avatar
+ 5
Find the class that has the main method and right click and go down to Run and then run as Java Application.
14th Dec 2018, 2:49 AM
Lambda_Driver
Lambda_Driver - avatar
+ 4
Yes, find the class with main method in the ide you are using
14th Dec 2018, 3:14 AM
Lambda_Driver
Lambda_Driver - avatar
+ 2
Just Google java compilation software?
14th Dec 2018, 2:26 AM
Dustin James Locey
Dustin James Locey - avatar
+ 2
Like eclipse ide?
14th Dec 2018, 2:27 AM
Dustin James Locey
Dustin James Locey - avatar
+ 2
Do I have to get a .class file?
14th Dec 2018, 2:31 AM
Dustin James Locey
Dustin James Locey - avatar
+ 1
Most Easiest way is download java compilation software and run your programme on it.
14th Dec 2018, 2:24 AM
Al Shihabul Alam
Al Shihabul Alam - avatar
+ 1
Yeah.. Like Codeblocks for c/c++
14th Dec 2018, 2:28 AM
Al Shihabul Alam
Al Shihabul Alam - avatar
+ 1
When I try to run my program, it says, "The selection cannot be launched, and there are no recent launches". Sorry, I'm a beginner
14th Dec 2018, 2:29 AM
Dustin James Locey
Dustin James Locey - avatar
+ 1
Depends if you are using an IDE or Text Editor (For Example: Notepad++)
14th Dec 2018, 2:36 AM
Kevin Astorga
+ 1
Notepad++
14th Dec 2018, 2:42 AM
Dustin James Locey
Dustin James Locey - avatar
+ 1
I tried the ide, but it isnt working for me
14th Dec 2018, 2:42 AM
Dustin James Locey
Dustin James Locey - avatar
+ 1
In ide?
14th Dec 2018, 2:55 AM
Dustin James Locey
Dustin James Locey - avatar
0
if you have windows operating system though you download atom /vscode for best. and download gcc /java package. and press F5. and if you have Ubuntu/Fedora then open terminal and go in your file folder or directory. and write commands compilers name filename.hava ./a
14th Dec 2018, 3:56 AM
HARSHAD