• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error in JAR file

 
Raza Shafiq
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1051
5
Chrome Eclipse IDE Hibernate
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How are you trying to run the jar?
 
Raza Shafiq
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
double click on it !
 
Paul Clapham
Sheriff
Pie
Posts: 20729
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
believe me no console appear
 
James Boswell
Bartender
Posts: 1051
5
Chrome Eclipse IDE Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Raza

Try writing the string to a file instead of console to verify if it is working or not.
 
Paul Clapham
Sheriff
Pie
Posts: 20729
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic