Reputation: 701
I have started learning Java and I have 1 issue:
I write a simple class and it runs and everything's fine. I took all the project from my Laptop to my other computer and from Eclipse I choose "File --> Open File" and choose my .java file.
When I try to run my program this windows pop up:
and after trying both option nothing happen.
How can I run my program and what is the problem ?
Upvotes: 0
Views: 17036
Reputation:
you need to create your public class and then just click on the green button with the white triangle on it ;) See here: https://i.sstatic.net/5TEtI.png
Upvotes: 0
Reputation: 1641
There is no problem with learning Java with Eclipse or any other IDE. If you move file from one computer to the other you need as it was said start a new project or you can use existing project and import files. In order to import files right click on a project and click then Import and select files. Then you should be able to run your class. Also be sure to have the Java perspective selected when you work on your class.
Upvotes: 0
Reputation: 8230
Perform the following steps:
Upvotes: 1
Reputation: 767
if you are just starting learning Java and dont understand whats going on with all that stuff with eclipse, I would recommend you to start from the basics, write your code in an ordinary text editor (notepad will do, or notepad++ if you want something more), after you have written and saved your source file, open up your command prompt, navigate to the location of the file, and run:
javac YourFileName.java
java YourFileName
here is more detailed guide:http://introcs.cs.princeton.edu/java/15inout/windows-cmd.html
Upvotes: 0