File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Looking for someone to help me change a .class file in a .jar file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Looking for someone to help me change a .class file in a .jar file" Watch "Looking for someone to help me change a .class file in a .jar file" New topic
Author

Looking for someone to help me change a .class file in a .jar file

Juan Rautenbach
Greenhorn

Joined: May 21, 2011
Posts: 4
Hi,

I'm looking for someone to help me with a enhancements to a program I'm using. It's opensource and the enhancements is public available but I'm not a programmer yet, I just don't know any thing about Eclipse although I tried.

There are "simple" instructions in the manual but I'm not finding it simple.

Can anyone please help me. I think for someone with the knowledge it will take 5min.

Regards,

Juan
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14114
    
  16

Welcome to the Ranch!

Just post some more details about your problem here, there are lots of people who can help you solve this if you just explain in more detail what the problem is. What do the "simple" instructions say and what part do you not understand?

If you're very new to Java, I'd suggest not using Eclipse. You already have enough to learn the basics of Java, it's going to be too much if at the same time you're trying to learn how the Eclipse IDE works.

Packaging files into JAR files is done with the jar tool on the command line. This tutorial explains it all in detail.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Juan Rautenbach
Greenhorn

Joined: May 21, 2011
Posts: 4
Thank you for the welcoming.

We are using a program OpenBravo POS. It is written en JAVA. It uses derby database to store the info ect.

The program has a function to work with scaled items, meat p/kg, chicken p/kg ect. But not automated.

Some one then explains on an enhancement for the program and gives you step by step info on what their problem was and how they solved it.

The link to the pdf where they show you everything:

http://www.google.co.za/url?sa=t&source=web&cd=1&ved=0CCQQFjAA&url=https%3A%2F%2Fpublications.theseus.fi%2Fbitstream%2Fhandle%2F10024%2F23394%2FEnhancement%2520of%2520Openbravo%2520POS%2520system.pdf%3Fsequence%3D1&rct=j&q=openbravo%20pos%20enhancment&ei=5YXXTbuOLYWYhQfr85m1Bg&usg=AFQjCNFALLAy7mPDeE0tt0oJ_St4OyAJ9g&cad=rja

on page 23 they have the development step and that's the "simple" part that I don't understand. I can do step a. but b. isn't to clear. I've tried creating a new project and just get stuck. It doesn't give me the option to create a .java file or I'm just not educated. I have a lot of training materials but to first go through that will take forever.

5. Development Process
Based on the research of the barcode and the software, the process of the
enhancement of the system can be made and the steps can be shown as follow:
a) Get the source code by decompiling the .jar file with JD-GUI.
b) Create a new project in Eclipse and add all libraries to the project.
c) Create a .java file with the same name of the .class file needed to be changed.
d) Copy the source code to .java file. Implement the code and build it.
e) Find the new .class file. Normally it is under the directory ‘workspace/project
name/packages/Bin’.
f) Open the .jar file with WINRAR. Find and replace the .class file which needs to
be changed by the new one.
g) Change the .jar file of the software by the new one and start the software to test
the implementation.

Also I have the .jar file (1.6MB) and the enhancements already typed so its just copy and paste. And the also the making of the .class / .jar file.

Any other info needed please ask.

Juan
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18760
    
  40

Juan Rautenbach wrote:
on page 23 they have the development step and that's the "simple" part that I don't understand. I can do step a. but b. isn't to clear. I've tried creating a new project and just get stuck. It doesn't give me the option to create a .java file or I'm just not educated. I have a lot of training materials but to first go through that will take forever.


All versions of eclipse are slightly different, but it should be close to this...

To create a new project, from the package explorer (left side), right click to bring up the menu, choose new --> project, and then follow all the wizard instructions on creating the project.

To create a .java, click on the project (package explorer) that you just created; then right click to bring up the menu, choose new --> class, and then follow the wizard. BTW, depending on the name of the file, you may have to create a package first too.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18760
    
  40

Juan Rautenbach wrote:
Some one then explains on an enhancement for the program and gives you step by step info on what their problem was and how they solved it.


BTW, this "enhancement" is far from official. You are basically taking someone's library and changing it without permission (or support). If the owner decides to obfuscate the code, or even just enhances it, these instructions may not work. Or worse, it may work, but is buggy.... Regardless, it isn't "simple".

Henry
Juan Rautenbach
Greenhorn

Joined: May 21, 2011
Posts: 4
Hi Henry,

The software is open source and they encourage the changes if we need it. The way we are using the Point of Sale software is a whole lot different than what the program can offer. So the enhancements that these guys did is what will be the solution to our automated problem.

Here is a link to the Developers Guide of the software (OpenBravo POS). http://wiki.openbravo.com/wiki/OpenbravoPOS_Developer_guide

I'm now busy to see if I can maybe get it to work through Net beans.

I've seen how this works in a store in London and just need to implement it in our store.

Juan
Juan Rautenbach
Greenhorn

Joined: May 21, 2011
Posts: 4
Henry,

I have now downloaded the source code for the software from the developers website. Will see if this will be easier to manipulate to see if it works.

Thanks for the advise,

Juan
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Looking for someone to help me change a .class file in a .jar file