-4

I started using eclipse for the first time(earlier I always used NetBeans).

The problem is that not even a simple "hello world " program is working in it.

Path is set and everything is working from the command line but when I run any particular project in eclipse the console just shows:

terminated theclassname [Java Applcation] c:\program files\java\jre1.8.0_45\bin\javaw.eve

Everything is working fine from the command line, please tell me what seems to be the problem?

When I ran eclipse a couple of hours ago, everything was working fine but now it is consistently showing this problem.

Edit:

here is the code, as per the request in the comments:

public class test {
    public static void main(String args[]) {

        System.out.print("Hello!!");

    }
}

But the problem is not about this program, the problem is nothing is working no program is working. I just stated "a simple hello world" program as an example!

niyasc
  • 4,440
  • 1
  • 23
  • 50
Kaushal Jain
  • 139
  • 1
  • 11
  • as you mentioned there is something wrong with your installation or how you have configured Eclipse – Pankaj Nimgade Apr 24 '15 at 06:10
  • Edit and post your simple "hello world" –  Apr 24 '15 at 06:11
  • @PankajNimgade what do you mean by configured Eclipse, I am sorry I am using it for the first time. I just downloaded it and started. Please tell me if there are some procedures which need to be adopted for it's configuration? – Kaushal Jain Apr 24 '15 at 06:17
  • @KaushalJain No, there is no special configuration needed after downloading and installing Eclipse. Additionally, when running a standalone Java application from inside Eclipse, you will always get a console output in the console view which afterwards will always show that the process is terminated (as you described). Maybe a screenshot will help showing us your problem? – Seelenvirtuose Apr 24 '15 at 06:20
  • How are you running the file? Do a `Project->Clean` and then Do a `Ctrl + F11->Run as Java Application`. – LittlePanda Apr 24 '15 at 06:23
  • Its not an error its information that your program has run and exited. Are you not getting required output? – Deepankar Singh Apr 24 '15 at 06:39
  • @KaushalJain, https://wiki.eclipse.org/Eclipse/Installation – Pankaj Nimgade Apr 24 '15 at 06:50
  • @DeepankarSingh yes I am not getting any output! – Kaushal Jain Apr 24 '15 at 08:04

2 Answers2

0

Your ecilipse is using javax.exe to run the program. Please check in the eclipse window-->preferences-->installed Jres--> Check here whether the path of the JDK or JRE you have is fine or not.

If not please modify it to correct path.

raki
  • 195
  • 1
  • 10
-1

You should use java.exe (not javaw.exe) to run your program.

see: difference-between-java-javaw

you chould check your jdk settings in your Eclipse preferences.

Community
  • 1
  • 1
Roy Xiao
  • 1
  • 1