aspose file tools*
The moose likes IDEs, Version Control and other tools and the fly likes Error in JAR file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Error in JAR file" Watch "Error in JAR file" New topic
Author

Error in JAR file

Raza Shafiq
Greenhorn

Joined: Aug 27, 2012
Posts: 9
hello
i am using netbeans and working on small database project
when i compile and run the project in netbeans its run (work) fine
but when i create the jar file and run it then nothing happens!!!
James Boswell
Bartender

Joined: Nov 09, 2011
Posts: 1031
    
    5

How do you expect people to help you when you provide such a brief, uninformative description of the problem?

How are you running the project in NetBeans?

How are you running it outside of the IDE?

So what actually happens when you run it?

How are you verifying that "nothing happens"?
Raza Shafiq
Greenhorn

Joined: Aug 27, 2012
Posts: 9
i use the clean a build option to create tha jar file and when i double click on that jar file computer busy for short moment then nothing happen
Raza Shafiq
Greenhorn

Joined: Aug 27, 2012
Posts: 9
package javaapplication2;

/**
*
* @author Raza Shafiq
*/
public class JavaApplication2 {

/**
* @param args the command line arguments
*/
public static void main(String[] args) {
System.out.println("Raza");
// TODO code application logic here
}
}
Raza Shafiq
Greenhorn

Joined: Aug 27, 2012
Posts: 9
after that i build this simple project for check jar file created but same situation this jar file also doesnt run
but i download a jar form net and that downloded jar file run perfectly
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5845
    
    7

How are you trying to run the jar?


JBoss In Action
Raza Shafiq
Greenhorn

Joined: Aug 27, 2012
Posts: 9
double click on it !
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18987
    
    8

Raza Shafiq wrote:i use the clean a build option to create tha jar file and when i double click on that jar file computer busy for short moment then nothing happen


Was the code you posted the code you expect to be executed?

Then "nothing happen" isn't quite true. What does happen is that "Raza" is written to the console -- which you can't see -- and then the application terminates.
Raza Shafiq
Greenhorn

Joined: Aug 27, 2012
Posts: 9
believe me no console appear
James Boswell
Bartender

Joined: Nov 09, 2011
Posts: 1031
    
    5

Raza

Try writing the string to a file instead of console to verify if it is working or not.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18987
    
    8

Raza Shafiq wrote:believe me no console appear


Yes, that is exactly right. When you run an executable jar like that, you do not see any console. That's how it works. That is why you don't see any output from that code you wrote.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error in JAR file