Questions tagged [mainclass]

92 questions
72
votes
7 answers

Maven adding mainClass in pom.xml with the right folder path

I want to get a working jar file with my maven project. The build part is: org.apache.maven.plugins maven-checkstyle-plugin
NhatNienne
  • 937
  • 3
  • 11
  • 20
30
votes
6 answers

"Could not find the main class" when double-clicking .jar file

First: I realize that this issue should be quite simple and lots of people seem to have experienced it. However, it appears my issue may be slightly different from existing posts. I'm using NetBeans to compile a Java application. When it's done…
aardvarkk
  • 14,955
  • 7
  • 67
  • 96
8
votes
2 answers

Why it could not find the main class?

I have a very simple code: package mygame; public class RunGame { public static void main(String[] args) { System.out.println(args[0]); } } I can compile that code but I cannot run it. When I type "java RunGame" in the command line…
Roman
  • 124,451
  • 167
  • 349
  • 456
7
votes
1 answer

main class of a tomcat web application

I have a client server application. The server is made of restful services with jersey and is deployed on tomcat 7. Actually, I need to create the context of the services (read some high sized files) before the client access to the services. Is it…
TheFrenchGuy
  • 233
  • 1
  • 3
  • 14
7
votes
2 answers

Java: recursion within main-class calls subclass-method instead of its own method

Example: class MainClass { public doIt() { ... else doIt(); } } class SubClass extends MainClass { @Override public doIt() { super.doIt(); ... } } Now the problem is: I call…
6
votes
3 answers

Doxygen won't process main.cpp

So I'm new to using Doxygen and I was able to get it to work smoothly. I was able to document my classes and structs and it generates the HTML files perfectly. The issue I'm running into is it won't parse my main.cpp file. All the classes and…
Alex
  • 1,082
  • 17
  • 27
4
votes
1 answer

how to run a class from java jar file on Hadoop?

I have a jar file exported from Eclipse (Runnable JAR>>Copy required libraries into a sub folder). In java if you set the main class in the manifest.xml you can run: java -jar MyTest.jar arguments if you want to run another main class in the jar…
Mosab Shaheen
  • 1,114
  • 10
  • 25
4
votes
3 answers

ClassNotFoundException: org.springframework.context.support.AbstractApplicationContext

I am trying to follow this Apache CXF – JAX-WS – Simple Tutorial but building the downloaded sample (out of the box!) creates a client that upon invocation refuses to run, issuing this error: Failed to load Main-Class manifest attribute from …
Introspective
  • 554
  • 2
  • 5
  • 13
3
votes
1 answer

java -cp "lib/*" versus java -cp "lib/*.jar"

If the lib/ directory contains only .jar files, what's the difference between java -cp "lib/*" ... and java -cp "lib/*.jar" ... If I use the latter I ran into errors regarding main class and I don't understand why. lib/* also contains lib/., but…
Alexandru
  • 25,070
  • 18
  • 69
  • 78
3
votes
1 answer

not able to find or load main class Files

I'm trying to build a simple jdbc database call application. I have the jars in the buildpath and and my sqljdbc_Auth.dll is in the folder: C:\Program Files (x86)\jdbc\sqljdbc_4.0\enu\auth\x64 I'm getting this error message Error: Could not find…
wjhplano
  • 611
  • 2
  • 13
  • 31
3
votes
3 answers

.jar file do not contain Main-Class attribute in manifest.mf

I am trying to run jar file through java -jar jts.jar but it is unable to run because it's Manifest.mf do not contain 'Main-Class' attribute, which is necessary for a jar file to run. I am have same problem with 9-10 .jar files. Help me with how to…
user2496080
  • 31
  • 1
  • 2
3
votes
2 answers

"Error: Could not find or load main class com.mycompany.App" when trying to execute Maven-generated Jar

I'm trying to build a maven java program on on Windows7 and my java -version is 1.7. I'm getting this error: "Error: Could not find or load main class com.mycompany.App" when trying to execute Maven-generated Jar even though…
Ian Walter
  • 882
  • 2
  • 8
  • 23
3
votes
0 answers

Error: no main manifest attribute, in matlab.jar

I installed MATLAB on Fedora and tried to run it using java -jar matlab.jar, but I got this error: no main manifest attribute, in matlab.jar I read somewhere to make a manifest file with below content: Main-Class: MainClass but when I ran java…
Nima
  • 490
  • 2
  • 10
  • 19
2
votes
0 answers

getClass().getAnnotations() does not return all the annotations when using spring application context

When I ask the spring application context to give me the main class of my application, using applicationContext.getBeansWithAnnotation(...), I can only access two of the class annotations : @SpringBootApplication @EnableJpaRepositories So if I ask…
Flyout91
  • 782
  • 10
  • 31
2
votes
1 answer

sbt deprecation warning <<= replaced with := results in no main class found

When using sbt 0.13.13. I could observe that when using := no main class is found (but no deprecation warning is shown), and for <<= I get the warning, but the main class is found. What is wrong here? run in Compile := Defaults.runTask(fullClasspath…
Georg Heiler
  • 16,916
  • 36
  • 162
  • 292
1
2 3 4 5 6 7