Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
New to Java
#1
hi,
am new to java, i wrote a simple hello world program in eclipse.
-----------------------------------------------------
lachu.java
-----------------------------------------------------
Code:
public class lachu {
    public static void main(String[] args){
    System.output.println("This program displays the name lachu ;-)");    
    }
    
}
-----------------------------------------------------
but after running its shows an error

"Error: Could not find or load main class lachu"
please any 1 tell me what should i do.
#2
Hello Vijayraj34!

First of all, welcome to the forums! A little tip for you: whenever putting code into a forum post, please enclose it with the code tags "
Code:
" and "
" - I have already edited your post to be as such.

I have never encountered this problem while using eclipse. The only suggestion that I have is that you right click on the project and "Run As>Java Application", as such:

[Image: xfirstgany70.gif.pagespeed.ic.TgkwA6Gett.png]

I suggest that you read this article to get familiarized with the basics of Eclipse: <!-- m --><a class="postlink" href="http://www.vogella.com/articles/Eclipse/article.html">http://www.vogella.com/articles/Eclipse/article.html</a><!-- m -->

Also, in the code you submitted, System.output.println should be changed to System.out.println
My Blog | My Setup | My Videos | Have a wonderful day.
#3
Just a little tip:
If you write Java in Eclipse, it would be easier if you change the settings to Java projects. Here is how to do that: Window > Open Perspective > Java.
Also known as Rocketalypse.
System.out.println("I prefer Java.");
#4
[Image: error.jpg]

this is my error, the same code if i run in net beans works perfectly, why?
#5
Wow, that is really weird! Do you have the latest version of Eclipse and Java installed?

If reinstalling does not fix the problem, I have uploaded a .zip file that can be accessed at this link: https://dl.dropbox.com/u/398377/Java.zip. Simply extract it and run Eclipse (Java>Eclipse>EclipsePortable.exe). If it runs properly, then it was a problem with either your Eclipse or Java installation.
My Blog | My Setup | My Videos | Have a wonderful day.
#6
yup the new portable eclipse is running perfectly.
thank you for that.
and i have latest java also.
but actually in my old eclipse android developing tool was there, because of that the problem was coming or something else? pls explain me <!-- s:-) --><img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
#7
Hm, well it could have been a number of things. The android development kit may have messed something up, Java may have simply been misconfigured on your Eclipse. Like I said before, I have never encountered that error so I have no clue...
My Blog | My Setup | My Videos | Have a wonderful day.
#8
Can any 1 tell me how to connect a database to java program and i also want to access(R/W) database with a java program. Just give me very simple sample program.

db:MS Excel or MS Sql 2008
#9
I have no clue how to do this, sorry about that. However, if someone else on the forum knows, hopefully they'll chime in!
My Blog | My Setup | My Videos | Have a wonderful day.


Possibly Related Threads…
Thread Author Replies Views Last Post
  Java Game Help ThreeLeBlancs 1 9,101 08-04-2013, 11:12 PM
Last Post: brandonio21
  What is required to run the Java Framework? Derek275 1 10,784 01-07-2013, 07:04 PM
Last Post: WitherSlayer
  New Java Game - Space Thrashers Y brandonio21 2 13,150 01-03-2013, 12:40 AM
Last Post: brandonio21
  Java and Ubuntu? Derek275 0 6,468 12-04-2012, 04:54 AM
Last Post: Derek275
  Java and JavaScript Vinwarez 2 12,364 03-12-2012, 10:00 PM
Last Post: Vinwarez
  Need Java Help? vbcodegeek 2 11,652 08-20-2011, 03:03 AM
Last Post: vbcodegeek

Forum Jump:


Users browsing this thread: 1 Guest(s)