• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Error in JAR file

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!!!
 
Bartender
Posts: 1051
5
Hibernate Eclipse IDE Chrome
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How are you trying to run the jar?
 
Raza Shafiq
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
double click on it !
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
believe me no console appear
 
James Boswell
Bartender
Posts: 1051
5
Hibernate Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic