• Post Reply Bookmark Topic Watch Topic
  • New Topic

Java Problem  RSS feed

 
Prashant Shirode
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I am Extract source code from .jar file and after that i do changes in that and again i create jar file but it run only first screen so how i can create executable jar file???
 
Richard Tookey
Bartender
Posts: 1166
17
Java Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
'Executable jar' files don't ordinarily contain source files so are you un-jarring the jar file, decompiling the class files, modifying the resulting Java files, re-compiling the Java files and then re-building the jar? If this is your scenario then my experience is that unless it is a trivial program this is almost doomed to failure since the de-compilation is often incomplete.

However you are doing it you should read http://docs.oracle.com/javase/tutorial/deployment/jar/ .
 
Campbell Ritchie
Marshal
Posts: 56536
172
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And welcome to the Ranch
 
Prashant Shirode
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just want to know it possible to build .jar or not???
If yes, so how???
And i want to tell you one thing frankly,i am not doing any illegal program??
 
Rohit Kumar Singh
Ranch Hand
Posts: 105
Eclipse IDE Java jQuery
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Prashant Shirode wrote: I just want to know it possible to build .jar or not???
If yes, so how???
And i want to tell you one thing frankly,i am not doing any illegal program??



Why are you so arrogant man ???

Be cool, you are at the right place ...

and BTW


Welcome to the Ranch
 
Richard Tookey
Bartender
Posts: 1166
17
Java Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Prashant Shirode wrote: I just want to know it possible to build .jar or not???
If yes, so how???

I presume that you did not find the tutorial on creating jar files helpful so what is it missing?
 
Prashant Shirode
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Sorry friends, I am lots of tense so the actual problem is that when i create jar file it does not contain any missing content, but it only run first screen after that it close the Complete program??
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The first step (like always) when you try to fix something, is to find out what exactly is going wrong.
Run your jar from the command line (java -jar JarFileName.jar) and observe if you see any exceptions on the console.
 
Prashant Shirode
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Yes it show Exception(java.lang.NullPointerException)...
So how it removes???
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The stack trace will tell you exactly which file and which line number is generating the NPE. Do you know how to glean that information from the stack trace? If not, copy past the stack trace here so we can take a look (Please dont forget to UseCodeTags )
 
Prashant Shirode
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

But the code run on net beans...
 
Muhammad Khojaye
Ranch Hand
Posts: 449
IntelliJ IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Prashant Shirode wrote: I just want to know it possible to build .jar or not???
If yes, so how???

You can also create Jar from IDE you are using, for instance, see Creating Jar file from Eclipse
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Prashant Shirode wrote:
But the code run on net beans...

Yes. Thats what we are trying to help you figure out. Runs in IDE doesn't run in jar and throws a NPE.
Until you post that stack trace, we cannot really help.
 
Prashant Shirode
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I don't know how to use stack trace, so please help me how to use stack trace in my project???
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Prashant Shirode wrote:
I don't know how to use stack trace, so please help me how to use stack trace in my project???

Initially you told us
Yes it show Exception(java.lang.NullPointerException)...

So run it from the command line again and copy paste the whole console output here (like I mentioned earlier, please UseCodeTags)
 
Prashant Shirode
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

The Following Error show:

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException

at admin.Login.access$400(Login.java:38)
at admin.Login$4.actionPerformed(Login.java:129)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Sour
ce)
at com.jtattoo.plaf.BaseButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Sour
ce)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Sour
ce)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Sour
ce)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.WaitDispatchSupport$2.run(Unknown Source)
at java.awt.WaitDispatchSupport$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.WaitDispatchSupport.enter(Unknown Source)
at java.awt.Dialog.show(Unknown Source)
at java.awt.Component.show(Unknown Source)
at java.awt.Component.setVisible(Unknown Source)
at java.awt.Window.setVisible(Unknown Source)
at java.awt.Dialog.setVisible(Unknown Source)
at admin.Login$8.run(Login.java:343)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Sour
ce)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
 
Campbell Ritchie
Marshal
Posts: 56536
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Find line 38 of the 400th (!!) anonymous class in the Login.access (incorrect capitalisation) class. And the actionPerformed method of the 4th anonymous ActionListener in the access.Login class, line 129. Write those lines out.
 
Prashant Shirode
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


38th Line:
public class Login extends JDialog

128th Line:
public void actionPerformed(ActionEvent evt) {
Login.this.jBloginActionPerformed(evt); } });
 
Campbell Ritchie
Marshal
Posts: 56536
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Precede that line 129 with
 
Prashant Shirode
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Now it shows error are:
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at javax.swing.ImageIcon.<init>(Unknown Source)
at admin.service.initComponents(service.java:235)
at admin.service.<init>(service.java:145)

Line No:145
initComponents();

For all images which i add in the project show error as above:
Syntax for image insert on Button:
Line No:235
this.jBrgistration.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/registration.png")));
For Label:
this.jLabel1.setIcon(new ImageIcon(getClass().getResource("/images/images.jpg")));

 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

So where is the images folder located in relation to admin.service
 
Prashant Shirode
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

In Project folder there is images folder in that registration.png & all images are stored...
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Prashant Shirode wrote:
In Project folder there is images folder in that registration.png & all images are stored...

Please read my question carefully and provide a meaningful and useful answer
Maneesh Godbole wrote:So where is the images folder located in relation to admin.service

 
Prashant Shirode
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Yes i got the .jar, Thank you for everyone for give me such a wonderful suggestion...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!