main « jar « Java I/O Q&A





1. Drop file onto .jar and pass filename to main()    stackoverflow.com

I'd like to drop a file onto my jar and have the filename passed on to my main method as argument. I'm on OSX. How can I do that?

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

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 ...

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

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 ...

4. Jar file "cannot find main class" from certain directories, works from others    stackoverflow.com

The problem is in the title - from my Desktop directory my jar file runs fine. From AppData/Roaming directory, it will not run at all and gives the error "cannot find ...

5. How can I create a Class file and JAR file without main function?    stackoverflow.com

How can I create the class file and jar file for this coding, when I compile this program its not working because there is no main function in the program. And ...

6. adding main class into the manifest file    stackoverflow.com

I created a jar file like this :

jar cf myJAR.jar *.class
But this thing is not executable because the mainfest file does not know in which .class file is the main file ...

7. ClassNotFoundException: Main Class in JAR file via ANT build    stackoverflow.com

Basically I'm attempting to run a JAR file which I've created using an ANT buildfile. The program needs to use an external jar in order to compile correctly. I've included it ...

8. How to Run a jar file which contains clojure and java code compiled class files. java file contains main method    stackoverflow.com

java -cp clojure.jar clojure.main compile.clj this is compiling the clojure code. javac CalculateSum.java compiling java code. jar cvf sum.jar *.class getting jar file of class files. java CalculateSum is running main and giving output ...

9. Creating jar file forcing the jvm to take the desired main method    stackoverflow.com

I have faced this question in the interview so that I am posting this here where I believe I can get answer. this is what is the question.

  1. I have four Java files, ...





10. Java 1.7 Desktop Application - Invalid Signature file digest for Manifest main attributes    stackoverflow.com

Using NetBeans 7.0.1 I created a simple desktop application that uses the jvFTP client. The application is nothing more than a form with a single "test" button that connects to ...

11. "Failed to load Main-Class manifest attribute from client.jar" in a possible malware .jar file?    stackoverflow.com

I found a Client.jar file on a customer's computer, containing two .class files which I could decompile to this two files: Client.java I.java Moreover there's a I.gif which is obviously ...

12. Main Class Not Found in JAR file    coderanch.com

Hello all, I'm attempting to export a JAR file from a package in my Eclipse 3.1 workspace (Windows XP) that contains a class with my main method and for some reason, at runtime I receive an error from the JVM that it cannot find my main class. The class was assigned in the JAR wizard, it is listed in my manifest ...

13. cannot find main class.program will exit. error in jar file creation    coderanch.com

D:\pro>jar tvf test2.jar 0 Sat Mar 13 16:39:48 IST 2010 META-INF/ 97 Sat Mar 13 16:39:48 IST 2010 META-INF/MANIFEST.MF 7044 Sat Mar 13 08:58:44 IST 2010 BasicJDBCDemo.class 8470 Sat Mar 13 08:58:44 IST 2010 Classifier.class 516 Sat Mar 13 08:58:44 IST 2010 ConnectDialog$1.class 543 Sat Mar 13 08:58:44 IST 2010 ConnectDialog$2.class 543 Sat Mar 13 08:58:44 IST 2010 ConnectDialog$3.class 4350 Sat ...

15. Can't run main class from JAR file    coderanch.com

I'm trying to run the main() method of a class contained within a JAR file. Here's the error message I get: Exception in thread "main" Could not find the main class: com.mycompany.package1.MyClass. Program will exit. Here's what the manifest file looks like: Manifest-Version: 1.0 Archiver-Version: Plexus Archiver Created-By: Apache Maven Built-By: some_user Build-Jdk: 1.6.0_26 Package: com.mycompany.package1 Main-Class: com.mycompany.package1.MyClass Class-Path: lib/JARfile1.jar lib/JARfile2.jar ...

16. Jar file could not find the main class    java-forums.org

I just clean and built main project in netbeans, however the jar file will not run. It gives me the error: could not find the main class: game.HangmanUI. I've already set that as my main class, the program works and everything just the jar file does not run. How do I get it to run?





17. .jar file cant find main class    java-forums.org

18. Why isnt my JAR file not working outside of the main folder with bluej classes?    java-forums.org

I made a jar file and it works fine while the jar file is inside the folder with the bluej classes. But when i drag to to the desktop for example, the program doesnt run anymore. I double click nothing happens. i googled the problem and i could not find anything. Please help resolve my issue.

19. jar file: Cannot find Main class    forums.oracle.com

Hello everyone, I have a jar file which was created with the following Manifest.MF file: Main-Class: a.Main Please note that the name of my main class is 'Main' The manifest file generated by the jar utility is as follows: Manifest-Version: 1.0 Created-By: 1.4.2_04 (Sun Microsystems Inc.) Main-Class: a.Main Whenever I run the executable jar file I get an error saying: Could ...

20. jar file error: could not find main class. program will exit    forums.oracle.com

I have created a jar file using following command jar cfm MyProj.jar Manifest.txt richa\*.class and I have included main class header in the Manifest.txt. The executable jar file is created but when I double click on it, it prompts an error Could not find the main class. program will exit. Please help. Its urgent.. Thanks in advance

21. execute jar file: "could not find the main class" program will terminate    forums.oracle.com

//int numb = Integer.valueOf( TIP.getText() ).intValue(); StringTokenizer tokenizer = new StringTokenizer(TIP.getText(), " "); String[] split = null; int tokenCount = tokenizer.countTokens(); if (tokenCount > 0) { split = new String[tokenCount]; for (int current = 0; current < tokenCount; current++) { split[current] = tokenizer.nextToken(); } } viewer.setText(" " + String.valueOf(numbers) + " ");

22. Moving .jar file stop it from executing (Could not find Main class. Pro..)    forums.oracle.com

I have several programs compiled as .jar files. They execute nicely when I double click them (windows xp os). However once I move the files out of the dist folder and onto my desktop or send them via email to another computer with a JRE on. The don't execute anymore. Instead I get a dialogue that pops up saying: (Java Virtual ...

23. Could not find Main Class while running JAR outside /dist directory    forums.oracle.com

Hello I can make jar on netbeans by clicking Shift+F11. But the problem occurs when I copy paste my jar file out of /dist directory. It only works at /dist directory. I think my way making jar is incorrect. Anyone knows a way to make runnable jar by NetBeans instead of Shift + F11

24. jar file could not find main class.. I cant see why?    forums.oracle.com

im only collecting my IP, the program visits www.whatismyip.org and records my external IP.. it does this every 15 mins and if he IP has changed, it emails me to notify me of the new IP There have been several times when I've been at university wanting to get onto my home computer using VNC but have not known my IP ...

25. Main class in a Jar File    forums.oracle.com

Hi I have created a ja file containing my whole project. the jar file contains a java class which contains a main method. now i want to run this java class present in my jar file from the command prompt. is it possible to do it. can we run a java file which is inside the jar file. i don't want ...