Skip to main content

All Questions

Filter by
Sorted by
Tagged with
0 votes
0 answers
21 views

i try to run jar file of game but it is not running showin jni erro has occured

enter image description here i created jar file of snake game. in eclipse snake game is running properly but after creating jar file it s not running as expected i am expecting it should run after ...
Sushant Dake's user avatar
1 vote
0 answers
557 views

Fails to run a Jar file on macOS using Zulu JRE (8.271)

java -jar jarfile works perfectly on Windows/Ubuntu, yet on macOS, I keep getting "Could not find or load main class." Not only that, when I run the jar using Oracle's JRE - it works (the ...
Avi Edri's user avatar
5 votes
2 answers
9k views

IntelliJ build wrong JAR: Could not find or load main class

I have a simple example public class FileSystemReadFile { public static void main(String[] args) throws IOException { System.out.println("Reading the file" + args[0]); } } which is ...
laggerok19's user avatar
3 votes
0 answers
1k views

Class is present in JAR, but still "Could not find or load main class"

I downloaded and installed UMD's FindBugs 3.0 in /usr/local/share/findbugs-3.0: $ ls /usr/local/share/findbugs-3.0/ FindBugs.jar I have a little script to run it: $ cat ./findbugs FINDBUGS_HOME=/...
jww's user avatar
  • 102k
0 votes
1 answer
78 views

Find Main Class of referenced jar

A JavaFX application (jar) is referenced as an dependency in my project. The "Main Class" in this jar contains the main method and the start method, to run this application. Now i want to find this "...
AKR's user avatar
  • 531
1 vote
6 answers
680 views

Doesn't find my main class in a jar

I'm developing a program with three classes and also includes some external jar archives and classes. When I run it in Eclipse it works properly, but I need to try with some other programs, so I need ...
user2622471's user avatar
76 votes
22 answers
325k views

Could not find or load main class with a Jar File

I'm trying to load a jar using @echo off java -jar Test.jar pause With the manifest of Manifest-Version: 1.0 Main-Class: classes.TestClass In the Jar directory, I can clearly see a classes\...
Austin's user avatar
  • 4,919
4 votes
2 answers
601 views

Programmatically find main() method in collection of classes

I am working on a project that needs to take an arbitrary number of java files, compile them, jar them, then run them. The problem I'm facing is this: Which class do we run? Is it possible to find the ...
beta's user avatar
  • 647
3 votes
3 answers
7k views

The old "Java Could not find Main Class" Error

I know this question has been asked many and many times, but I have done my research and my simple test program still will not run on double click. When I run the program from the jar (java -jar Test....
sl133's user avatar
  • 1,359
7 votes
1 answer
18k views

How to run application from war?

I have a big war file, that contains many classes with main method. How I can point Java to run main specific class?
user710818's user avatar
  • 24.2k
1 vote
2 answers
752 views

Jar cannot be opened on different Computer ("Can not find main class")

Today I programmed myself a Little game, which I compiled into a jar through Eclipse - I made sure its a executable jar, or runnable jar or however you want to call it. I've sent the jar to a friend ...
Joe's user avatar
  • 258
1 vote
2 answers
2k views

Creating a .jar file - Get "Could not find main class" even with manifest.txt WITH a carriage return

I'm trying to create my first jar file and I'm having trouble. I'm using the DOS to do it and my path and everything are all set up correctly. These are the files I'm trying to include: Bot.class ...
Austin's user avatar
  • 11
2 votes
1 answer
1k views

How to conditionally include manifest options when making a JAR in ANT

I am using ANT to manage multiple projects. I have a build-common.xml script that individual projects include. Some projects are libraries, others are programs. For the programs, I would like to ...
schmmd's user avatar
  • 19.4k