0

Thats the output when i execute java -version

openjdk version "1.8.0_252" OpenJDK Runtime Environment (build 1.8.0_252-8u252-b09-1ubuntu1-b09) OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)

When i tried to execute my file with java -jar shows me a message that can't found/load the main class. I'm sure that this works because i try it in Windows and works done. I tried in a linux machine and works too. I don't know what i am doing bad, I'm beginner with linux by the way.

I tried to remove all the java stuff from my computer and reinstall java 8 version but still not works.

enter image description here

Thats how i tried to execute the command. I have one java in opt and with that one let me open it.

As admin is the same error but in spanish. enter image description here

MANIFEST

Ant-Version: Apache Ant 1.9.7
Created-By: 1.8.0_231-b11 (Oracle Corporation)
Class-Path: lib/hamcrest-junit-2.0.0.0.jar lib/java-hamcrest-2.0.0.0.j
 ar lib/testFx-3.1.0.jar lib/testfx-core-4.0.13-alpha.jar lib/testfx-j
 unit-4.0.13-alpha.jar lib/javax.ws.rs-api-2.0.jar lib/asm-all-repacka
 ged-2.2.0-b21.jar lib/cglib-2.2.0-b21.jar lib/guava-14.0.1.jar lib/hk
 2-api-2.2.0-b21.jar lib/hk2-locator-2.2.0-b21.jar lib/hk2-utils-2.2.0
 -b21.jar lib/javax.annotation-api-1.2.jar lib/javax.inject-2.2.0-b21.
 jar lib/javax.servlet-api-3.0.1.jar lib/jaxb-api-2.2.7.jar lib/jersey
 -entity-filtering-2.5.1.jar lib/jersey-media-moxy-2.5.1.jar lib/org.o
 sgi.core-4.2.0.jar lib/osgi-resource-locator-1.0.1.jar lib/persistenc
 e-api-1.0.jar lib/validation-api-1.1.0.Final.jar lib/jersey-client.ja
 r lib/jersey-common.jar lib/jersey-container-servlet.jar lib/jersey-c
 ontainer-servlet-core.jar lib/jersey-server.jar lib/eclipselink.jar l
 ib/UtillitiesProject.jar
X-COMMENT: Main-Class will be added automatically by build
Main-Class: windowsapplication.WindowsAppicationReto2

Any idea?

kriegaex
  • 63,017
  • 15
  • 111
  • 202
JarssS8
  • 61
  • 1
  • 1
  • 12
  • How are you trying to run the jar ? java -jar (jar name) . If this is not wrong , can you open the terminal as an admin and try once? – Harmandeep Singh Kalsi Jun 05 '20 at 14:34
  • Please update your question with project's MANIFEST.MF and the whole command that you tried to run. – zforgo Jun 05 '20 at 14:35
  • When you're updating the question with the manifest and command, also include the actual error message, copied into the text we read here. – arcy Jun 05 '20 at 14:46
  • @HarmandeepSinghKalsi i add some images for you can see but yes im trying with that. – JarssS8 Jun 05 '20 at 14:50
  • 1
    @zforgo it's done. Was that you was asking for? – JarssS8 Jun 05 '20 at 14:51
  • @arcy It's done :) – JarssS8 Jun 05 '20 at 14:52
  • 1
    @JarssS8 The fact that a version of java will run the program indicates that the jar file is correctly built and contains what is necessary. I wonder if the 1.8.0_252 install of java could be faulty and therefore causing a problem. Can you write and execute a "Hello World" program with that version? No packages, no libraries, just print out Hello World. – arcy Jun 05 '20 at 16:14
  • @arcy after all the evening trying to solve it installing and purging packages i finally done with normal projects but with the jar from the screenshots i couldn't get it i really dont know why. Maybe because im using javafx there? And someone close me this question because is "repeated" when is not hahha – JarssS8 Jun 06 '20 at 21:43

1 Answers1

1

The answer is very simple: You have a typo in your manifest, as can clearly be seen both in your screenshots and in the manifest you posted itself:

Please change

Main-Class: windowsapplication.WindowsAppicationReto2

to

Main-Class: windowsapplication.WindowsApplicationReto2

App~l~ication with a lower-case "L".

kriegaex
  • 63,017
  • 15
  • 111
  • 202
  • This is a good catch, but leaves open the question why it was working on another system. Now that I look at it again, the spelling "Utillities..." in the last jar of the classpath seems to have an extra lowercase L in it. – arcy Jun 05 '20 at 19:35
  • With the typo in the manifest it cannot have worked on another system. The OP must have changed made the typo before building the version he tried on Linux. Or maybe in his build system there are platform-specific settings, duplicate files with differences or whatever. Without an [MCVE](https://stackoverflow.com/help/mcve) I can only speculate and that I do not like. I like to analyse facts. I do not understand why most people asking questions here seem to not care about writing good questions, even if it means they only get speculative answers instead of solutions to their problems. – kriegaex Jun 06 '20 at 00:59