Getting the "main class not found" error when trying to launch any Java Program

HattrickPat :

I can't launch any .jar program since Java doesn't find the main class. This is true for ANY program not just my self written. So it isn't just a faulty manifest that is causing it. I have tried to just reinstall the Java runtime and JDK and also I have checked the PATH environment variables. Java Runtime Version is "1.8.0_251" and JDK is "11.0.7". Another Error I am seeming to get is an java.lang.UnsatisfiedLinkError

I am trying to launch it via. "Java -jar C:...\Programname.jar" in the command prompt.

EDIT: So it is not applicable to any program. For example: This is one of the programs that are working like intended: http://www.softsea.com/download/Simple-Java-Calculator.html However Programs like these ones are producing the errors mentioned: https://sourceforge.net/projects/java-calculator/ http://www.java2s.com/Code/Jar/j/Downloadjavacalculator100rc20jar.htm

EDIT2: I had also an OpenJDK installed which seemed to cause a conflict. I saw that the Path Variable of the OpenJDK got prioritized. Basically I have had different versions for java and the java compiler, even though they shared the same version number. This is at least my interpretation of the problem. For further judgment I am lacking experience with java and lacking depper knowledge about the processes in question. After I changed this my own programs are working at least. The example programs still do not work. I expect a problem on their side or some still underlying problem I am unable to identify. When trying to find working programs to test if your Java is working, I will definitely not choose random google results for "basic calculator java" next time.

I am thankful for your help, time and patience and I am sorry for any inconveniences I may have caused you trying to help me find the solution to my problem.

HARSH CHOKSHI :
  1. Go to the option of environment variables and add PATH in the user variables section by pressing new button.

For example, PATH C:\Java\jdk1.8.0_191\bin Please use the version of your JDK in my case the jdk version is 1.80_191. It must match with the similar folder location

  1. In the system variable section add new variable with name variable name: JAVA_HOME variable value: C:\Java\jdk1.8.0_191\lib

  2. You must restart your computer after making changes to the environmental variables which is important.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Error when trying to launch program that uses libtcod for ruby

No Main Class found when running a dockerizing image

Java main class not found after renaming

Launch4j doesn't work (main class not found)

"process launch failed: unknown error" when trying to run Rust program via LLDB

when I am trying to launch my app in my device and I am getting the error as launch option nil in my xcode?

Getting error when trying to launch node.js app with PM2 Cluster

Why am I getting redeclared errors when trying to build any Go program?

java.lang.NumberFormatException Error shows when trying to run program

Error at top of program when trying to run java code

Main class not found error while creating Maven Project in Scala IDE

Getting a Java ProcessBuilder error when trying to run a Powershell script

Getting error when running the program

How do I fix Java Eclipse "Launch Error" when trying to run code?

unable to launch any program: trap int3 ip error

Getting fatal error A1008: unmatched macro nesting in masm when trying to run program

Supervisor: ERROR (spawn error) when trying to launch gunicorn

Permission denied error when using UseUrls() when trying to launch Kestrel

Compiler error when trying to run the below program

"An Unknown error occurred" When trying to launch my Siri Shortcut

Error when trying to launch powershell script from WinForms App

Error when trying to find ANY of int array

Getting error when trying to remove multiple directories

Getting error when trying to enumerate enum

Getting error when trying to subscribe to function in ngOnInit

Getting an error with Instagram when trying to authenticate

Getting error when trying to use cross validation

Getting error when trying to display button

Getting error when trying to store loop to array

TOP Ranking

  1. 1

    Failed to listen on localhost:8000 (reason: Cannot assign requested address)

  2. 2

    Loopback Error: connect ECONNREFUSED 127.0.0.1:3306 (MAMP)

  3. 3

    How to import an asset in swift using Bundle.main.path() in a react-native native module

  4. 4

    pump.io port in URL

  5. 5

    Spring Boot JPA PostgreSQL Web App - Internal Authentication Error

  6. 6

    Can't pre-populate phone number and message body in SMS link on iPhones when SMS app is not running in the background

  7. 7

    Do Idle Snowflake Connections Use Cloud Services Credits?

  8. 8

    maven-jaxb2-plugin cannot generate classes due to two declarations cause a collision in ObjectFactory class

  9. 9

    Binding element 'string' implicitly has an 'any' type

  10. 10

    BigQuery - concatenate ignoring NULL

  11. 11

    Compiler error CS0246 (type or namespace not found) on using Ninject in ASP.NET vNext

  12. 12

    In Skype, how to block "User requests your details"?

  13. 13

    Jquery different data trapped from direct mousedown event and simulation via $(this).trigger('mousedown');

  14. 14

    Pandas - check if dataframe has negative value in any column

  15. 15

    flutter: dropdown item programmatically unselect problem

  16. 16

    Generate random UUIDv4 with Elm

  17. 17

    Is it possible to Redo commits removed by GitHub Desktop's Undo on a Mac?

  18. 18

    ngClass error (Can't bind ngClass since it isn't a known property of div) in Angular 11.0.3

  19. 19

    Change dd-mm-yyyy date format of dataframe date column to yyyy-mm-dd

  20. 20

    EXCEL: Find sum of values in one column with criteria from other column

  21. 21

    How to use merge windows unallocated space into Ubuntu using GParted?

HotTag

Archive