First make sure that you made a regular "Java Project", and not something else.

If there's something wrong with the build configuration, which i guess there is, go to: Run > Run Configurations... On the left you will see a list of configurations, make sure your configuration runs as a "Java Application". If not, delete all the configurations by selecting them and then press delete.

If things are fine, your program should run normally

Answer from Hugo Kerstens on Stack Overflow
🌐
Reddit
reddit.com › r/learnjava › can't run java eclipse application, no error but some other application running
r/learnjava on Reddit: Can't run Java eclipse application, no error but some other application running
September 12, 2024 -

Hi,

I have written a simple Java application. However, when I execute the application, I get some other application being executed. My code is given below:

//Convert int to Integer
import javax.swing.*;
public class IntToInteger {
   int iA;
   IntToInteger(int iA){
   this.iA = iA;

}
    void ConvertIntToInteger(int iA){
       Integer iRes = Integer.valueOf(iA);
       JOptionPane.showMessageDialog(null, " "+ iRes);
    
    }
}

Some body please guide me.

The image is attached at:

https://ibb.co/r5dGVZt

Somebody please guide me.

Zulfi.

Top answer
1 of 4
4
You are definitely missing a main method in that class. I have not used Eclipse IDE in a while but I think if you add a main method to your class, there should be a small green run button that pops up next to it. If you try to run by pressing the run button on the top menu bar of the IDE I think it will run the last successful run configuration (probably some other project you ran before). So try adding: public static void main(String[] args) { IntToInteger program = new IntToInteger(42); program.ConvertIntToInteger(42); } There are some other things I would note regarding your code, first of all you are defining a class field called iA but in your ConvertIntToInteger method you are also defining a parameter called iA . This will shadow your class field iA and use the value you passed as a method argument instead (unless you do this.iA). So, you can probably either remove the class field and the parameter from the constructor of your class, or remove the parameter from your ConvertToInteger method. Also, in Java the convention is to start method names (except for constructors, of course) with a lower case letter.
2 of 4
1
Please ensure that: Your code is properly formatted as code block - see the sidebar (About on mobile) for instructions You include any and all error messages in full - best also formatted as code block You ask clear questions You demonstrate effort in solving your question/problem - plain posting your assignments is forbidden (and such posts will be removed) as is asking for or giving solutions. If any of the above points is not met, your post can and will be removed without further warning. Code is to be formatted as code block (old reddit/markdown editor: empty line before the code, each code line indented by 4 spaces, new reddit: https://i.imgur.com/EJ7tqek.png ) or linked via an external code hoster, like pastebin.com, github gist, github, bitbucket, gitlab, etc. Please, do not use triple backticks (```) as they will only render properly on new reddit, not on old reddit. Code blocks look like this: public class HelloWorld { public static void main(String[] args) { System.out.println("Hello World!"); } } You do not need to repost unless your post has been removed by a moderator. Just use the edit function of reddit to make sure your post complies with the above. If your post has remained in violation of these rules for a prolonged period of time (at least an hour), a moderator may remove it at their discretion. In this case, they will comment with an explanation on why it has been removed, and you will be required to resubmit the entire post following the proper procedures. To potential helpers Please, do not help if any of the above points are not met, rather report the post. We are trying to improve the quality of posts here. In helping people who can't be bothered to comply with the above points, you are doing the community a disservice. I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
Discussions

java - Program in Eclipse not Running - Stack Overflow
I've just installed Eclipse 4.2.0 and also imported all my old programs into it, except that when I run my programs, it pops up with a message saying: Select what to run: Ant Build: Launches an Ant More on stackoverflow.com
🌐 stackoverflow.com
September 2, 2012
java - Eclipse programs not running? - Stack Overflow
Explore Stack Internal ... I am new to java. I have just got Eclipse working (somehow) lol. well my programs are running fine until- I save a program, close out of eclipse, and re-open the program. when I try to run it the same way that works for all the other programs, I am getting a message asking to "run with ant build". for some reason eclipse will not ... More on stackoverflow.com
🌐 stackoverflow.com
compilation - Eclipse won't compile/run java file - Stack Overflow
Find the project INSIDE Eclipse's Package Explorer (Window -> Show View -> Package Explorer) Double-click on the project, then double-click on the 'src' folder, and finally double-click on one of the java files inside the 'src' folder (they should look familiar!) Now you can run the files as expected. Note ... More on stackoverflow.com
🌐 stackoverflow.com
Why Is My Eclipse Java Program Not Running - Error Message: "Error: Could not find or load main class" - Stack Overflow
That's why String is also underlined--it is not found because it's expected to be provided from a Java runtime. Double-check that the Installed JREs preference page has a valid Java 11 runtime defined. Eclipse uses Java to run itself, but you still have to tell it which JREs you want it to ... More on stackoverflow.com
🌐 stackoverflow.com
🌐
Coderanch
coderanch.com › t › 744642 › ide › code-running-Eclipse-main-method
why is the code not running in Eclipse when there is a main method? (IDEs and Version Control forum at Coderanch)
August 4, 2021 - Although Campbell tends to get rather tetchy ablout closing Scanners attached to stdin, if a program does nothing from stdin BUT Scan, closing the Scanner (and thus stdin) makes little difference. It's not a very user-friendly program, in fact, and the problem is made worse because it's not really designed to run in Eclipse, but to run as a stand-alone Java Application.
🌐
Stack Overflow
stackoverflow.com › questions › 12232446 › program-in-eclipse-not-running
java - Program in Eclipse not Running - Stack Overflow
September 2, 2012 - I wonder if it is because I imported my files incorrectly or something that I forgot to install. Please tell me how I can make it work properly again. Thanks in advance. ... You most likely need to configure it to run with Java.
🌐
The Eclipse Foundation
eclipse.org › forums › index.php › t › 1092788
Eclipse Community Forums: Java Development Tools (JDT) » Can't run java program in Eclipse - javaw error | The Eclipse Foundation
April 13, 2018 - The Eclipse Foundation - home to a global community, the Eclipse IDE, Jakarta EE and over 350 open source projects, including runtimes, tools and frameworks.
🌐
Quora
quora.com › I-cant-run-program-in-Eclipse-It-is-showing-a-message-that-no-recent-launches-are-available-How-do-I-fix-this
I can't run program in Eclipse. It is showing a message that no recent launches are available. How do I fix this? - Quora
Answer (1 of 2): Go to Run-> Run Configurations. * If there isn't create a new run configuration (top left) * Under Android tab: browse and select the project you want to run * Under Target tab: select Always prompt to pick device (or) you can pick automatic launch. Similar solution can be app...
Find elsewhere
🌐
The Eclipse Foundation
eclipse.org › forums › index.php › t › 487572
Eclipse Community Forums: Newcomers » Eclipse wont run my class | The Eclipse Foundation
May 15, 2013 - The Eclipse Foundation - home to a global community, the Eclipse IDE, Jakarta EE and over 350 open source projects, including runtimes, tools and frameworks.
🌐
Stack Overflow
stackoverflow.com › questions › 74034896 › why-is-my-eclipse-java-program-not-running-error-message-error-could-not-fi
Why Is My Eclipse Java Program Not Running - Error Message: "Error: Could not find or load main class" - Stack Overflow
That's why String is also underlined--it is not found because it's expected to be provided from a Java runtime. Double-check that the Installed JREs preference page has a valid Java 11 runtime defined. Eclipse uses Java to run itself, but you still have to tell it which JREs you want it to offer to compile your own projects against.
🌐
Super User
superuser.com › questions › 1418337 › why-is-eclipse-workspace-stuck-running-irrelevant-and-closed-java-code
Why is Eclipse Workspace stuck running irrelevant and closed Java code - Super User
March 27, 2019 - ... Have a look at your Run Configurations under the Run -> Run Configurations... menu. I suspect you have a configuration left from your old code. Whenever you run a piece of code, Eclipse creates a Run Configuration for it.
🌐
wikiHow
wikihow.tech › computers and electronics › software › programming › java › how to run java program in eclipse: beginner's guide
How to Run Java Program in Eclipse: Beginner's Guide
January 27, 2026 - Download and Install Java, and Eclipse if the programs are not yet installed. 2 · Create a New Java Project. Advertisement · 3 · Create a new class with following File > New > Class.. 4 · Enter name of the class and press finish. . 5 · Enter code statement System.out.println("Hello World"); and Save (Shortcut : CTRL+S). 6 · Run Program as shown in the image..
🌐
YouTube
youtube.com › watch
Why My Java Program Is Not Running In Eclipse? - Next LVL Programming - YouTube
Why My Java Program Is Not Running In Eclipse? Are you facing challenges while trying to run your Java program in Eclipse? In this video, we will guide you t...
Published: April 7, 2025
🌐
The Eclipse Foundation
eclipse.org › forums › index.php › t › 1098016
Eclipse Community Forums: Newcomers » Problem with running Java code | The Eclipse Foundation
The Eclipse Foundation - home to a global community, the Eclipse IDE, Jakarta EE and over 350 open source projects, including runtimes, tools and frameworks.
🌐
Stack Overflow
stackoverflow.com › questions › 32935095 › eclipse-not-running-java-program
Eclipse not running java program - Stack Overflow
October 4, 2015 - Cannot run program ""C:\Program Files (x86)\Java\jdk1.6.0_01\bin\javaw.exe"" (in directory "F:\Project\Java Practive"): CreateProcess error=1392, The file or directory is corrupted and unreadable · However when I am running same program using cmd it's running fine. ... Save this answer. ... Show activity on this post. After a digging deep I am able to find the solution- 1. Downloaded Eclipse IDE for 64 bit Windows 10 2.