Editing a JAR file?

Hi,
I need some insights on how to edit a .jar file using an IDE such as Eclipse. Could someone help me out?
Thanks!
Epithemeus

Epithemeus wrote:
The trouble though is that I received some compiled code (as a .jar file). The code uses paths to several files - I need to modify these paths for the code to be able to find my files locally.That might be tricky.
First problem is that you'll need to decompile and re-compile the source which might or might not work without any problems (jad is a halfway passable decompiler).
The next problem is that it might not be allowed to modify the .jar file at all, but that depends heavily on the laws of your location.
Any suggestions?Best solution based on correctness and reducing your workload: get the vendor of the .jar file to fix the problem (either make the paths configurable or at least make it use relative paths).

Similar Messages

  • How to edit a jar file ?

    Using JDeveloper 11.1.1.0 and it will not allow me to edit a jar file.
    Steps
    File -> Open and select a jar file
    Double Click on MANIFEST.MF
    The status bar displays "Read Only" and "Windows: CR/LF Editing"
    All versioning has been turned off.
    How do I get out of "Read Only" mode and be able to edit anything in the file ?????
    Thank you

    Come on, you can't be seriously try to edit a class file in side a jar.
    One of the reasons they are in a jar is that users don't fiddle around with them. If you have to manipulate the manifest you can do so in the deployment descriptor of the application in JDEV.
    If you are looking for something special in the jar there are a couple of explorer plug ins which allow you to do so (at your own risk).
    Timo

  • Editing the jar file

    this could be a silly/simple question. But I would like to know how can I edit the files inside adf-faces-impl.jar
    eg: I would like to change the calendar icon to a different one.
    thanks
    san

    San,
    Yiou are in the wrong forum, as this is not related to JHeadstart. Please post your question on the JDeveloepr forum.
    Steven Davelaar,
    JHeadstart Team.

  • How to edit a text file inside jar

    Hi all;
    I have a code that created text file and put this file to other jar archive.
    How can I edit this text file inside jar, add string to this file ?
    Thanks,

    Unpack the jar, edit the file, repack the jar.

  • Editting and re-jarring Jar files

    Hi.
    I've taken over someone else's code and I can't, for the life of me, figure out how to open the jar file in NetBeans for instance, edit some of the classes and jsp's, and then re-jar everything to deploy it.
    Thanks in advance for any help.
    Jeremy.

    Yeah, kinda like I already said over on your crosspost. Now you're just plain annoying for crossposting this.

  • Nokia 6280 how to enable read/edit for jar to file...

    how do I allow jar files to acces/edit/read files on my nokia 6280? when I try to allow it, its doesn't let me, please give me a guide on how to allow the jar files to acces/edit/read the files on my nookia 6280 thank you.
    sorry if its the wrong topic.
    Message Edited by vasilevich on 07-May-2008 10:46 PM

    Dats simple
    select ur application click option
    select application access menu
    after dat select add edit data select allow access to ask always or ask once or always allow(allowed only apps is download frm a secured source)

  • Loading jar files using loadjava - 11g Enterprise Edition 11.1.0.6.0-64bit

    Hi,
    We are trying to fetch data from a weblogic server using a JMS thin client.
    We have loaded our client code jar(application.jar) and the following thin client jars in oracle using loadjava.
    (Version:- Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production).
    1) wljmsclient.jar
    2) wlthint3client.jar
    3) wlclient.jar
    some of the classes remain in invalid state after loading the jar files. we validate them manually.
    When we run the client code we are getting following exception.
    ORA-29532: Java call terminated by uncaught Java exception: java.lang.InternalError: error initializing kernel caused by: java.lang.ExceptionInInitializerError
    at weblogic.protocol.ClientEnvironment.loadEnvironment(ClientEnvironment.java:22)
    at weblogic.kernel.Kernel.initialize(Kernel.java:92)
    at weblogic.kernel.Kernel.ensureInitialized(Kernel.java:64)
    at weblogic.rjvm.wls.WLSClientRJVMEnvironment.ensureInitialized(WLSClientRJVMEnvironment.java:55)
    at weblogic.protocol.ServerURL.getDefaultURL(ServerU
    Any help on the above issue?
    Thanks,
    Navin

    Hi;
    For your issue i suggest close your thread here as changing thread status to answered and move it to Forum Home » Database » JVM which is JVM dedicated forum site.
    Regard
    Helios

  • Unable to edit JSP files in a JAR file

    Hi,
    I am trying to edit biller direct screens and I am not able to open any JSP or XML file in NWDS editor. I get this below error whenever I try to edit a JSP file
    cannot open default editor on content_custExtension_html.jsp. Unsupported editor input type org.eclipse.jdt.internal.ui.javaeditor.JarEntryEditorInput
    any help will be rewarded for sure
    Thanks and regards,
    Nrisimhanadh Yandamuri

    Was mistaken... have to edit similar source in another DC.

  • Yet another problem getting a .jar file working on Mountain Lion

    The program I need to run is used for generating sounds. Its a simple java program, set up in a Windows .msi container: http://innertotality.com/?q=node/9
    I currently have the most up to date Java build from Oracle, according to their online test: v7 update 15. However, it shows up in Terminal after a java -version command as 1.6.0_41.
    Whatever version it is, I can't get this program running on it. I've pulled the .msi file apart to get the cab file, pulled that apart to get my jar file, in this case "headwave.jar". Clicking on it makes the JRE icon appear in the dock and do its dance, then it closes down. I can repeat that all I want and never get a running app out of it. I've opened the console up and watched for messages. This is all I've managed to get:
    2/23/13 9:58:44.218 PM login[2871]: USER_PROCESS: 2871 ttys000
    Nothing more, and I've only seen that once. I get more out of Console simply dragging a word around in this box to edit this post.
    If anyone could shed some light on what I need to do to get this running, I would greatly appreciate it. There are very few Mac OS X sound tools available to do what I need so this is really holding my project back. Most everything out there has to do with professional or amateur audio editing, not pure tone generation. I tried ToneGen and it just isn't doing what I need, and Perfect Tone and Tone Generator X haven't been updated for Intel Macs.

    No I haven't, but I just tried it. I tried to cd to the desktop (worked), found the Headwave folder with ls and then cd into it, found the jar folder I extracted earlier (disk1), cd into it, etc etc. I found HeadWave.jar and knew I had the right directory. java -jar HeadWave.jar gave me the following:
    Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: Widgets/JSSampleListener
              at headwave.Main.<init>(Unknown Source)
              at headwave.Main$1.run(Unknown Source)
              at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
              at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:708)
              at java.awt.EventQueue.access$400(EventQueue.java:82)
              at java.awt.EventQueue$2.run(EventQueue.java:669)
              at java.awt.EventQueue$2.run(EventQueue.java:667)
              at java.security.AccessController.doPrivileged(Native Method)
              at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlConte xt.java:87)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:678)
              at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:29 6)
              at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:20 1)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
              at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    Caused by: java.lang.ClassNotFoundException: Widgets.JSSampleListener
              at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
              at java.security.AccessController.doPrivileged(Native Method)
              at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
              at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
              ... 16 more
    This is the same message I received earlier. I'm sure the info I need is hidden behind the "...16 more" lol

  • Can Netbeans put a jar file In a jar file?

    I just went through the process of getting Eclipse to create a jar file that would execute from a command prompt using a plugin called fatjar :
    http://fjep.sourceforge.net/
    Details from other thread :http://forum.java.sun.com/thread.jspa?threadID=5219638&tstart=0
    I really would like to use netbeans but i now have the exact same problem trying to make a jar file in netbeans 5.5.1
    I am using a package from icaste.com It has a
    .dll file to put in the windows directory
    JCommSerial_3_0.jar file that contains all the classes
    I can compile and run a file in the IDE and it works fine
    The Jar file does not contain the classes so i get errors when running from command line.
    Here is the layout of my screen and result of run command in IDE
    http://www.acousticlights.com/netbeans.png
    What do I need to try?

    georgemc wrote:
    Why is everyone so obsessed with doing this? The gains are minimal and the problems numerousBecause we are new and don't understand how the java VM actually runs code and the error messages sent by the java machine are cryptic.
    My first attempt at using an external jar in a java program lead me to believe that all of the code for a java program would be in a jar file including external jar files, after all the JDK standard library has tons of jars in it so I assumed the external jar file would be linked (as most other programming compiler/linkers I have worked with in my top down programming life).
    I find out the answer is so simple that the external jar file could not be found by the VM running my jar file. Like I said, if the VM would have just gave me an error that it could not find a file on a specific directory i never would have perused the idea of jar in a jar (fatjar plugin for Eclipse for example)
    Really this is like getting into a race car and not knowing at what RPM to shift gears, sure you can press the pedal and make it go but if you don't understand how it works under the hood you are going to blow the engine if you keep it in first gear.
    I have read many posts on these errors, the reason is the error message is just not very descriptive of the original problem. If I try and open a database called xyz.dbf that has one field defined as lastname, in C for example, I would not give the error message "Lastname could not be found) when indeed the lastname could not be found but the reason it could not be found was because the database xyz.dbf could not be found. Further , adding to the error message that the system is looking for xyz.dbf on drive X- subdirectory -mydatabases would complete the error message and allow the user to fix the error. Just what is a non java programmer that is using my java program suppose to do with an Ecception Error in (main) bla bla bla... I know now I need to check for library files myself within my own java programs and give a better error message to the user before the java VM sends out it's cryptic message.
    Edited by: metron9 on Sep 25, 2007 11:00 AM

  • I Can't Create my jar File

    I have a package called voiceexpert which contains three classes: Disease, DiagnosingEngine and Symptoms which is a JavaBean. Symptoms makes use of Disease and DiagnosingEngine objects.
    voiceexpert is stored in the directory: c:\diagapp3
    I compiled Symptoms.java as below:
    c:\diagapp3> javac -d . Symptoms.java
    The class files for Disease.java, DiagnosingEngine.java and Symptoms.java are placed in the directory: voiceexpert.
    I created a Manifest.txt file inside c:\diagapp3 containing the following:
    Main-Class:voiceexpert.voiceexpert.Symptoms
    Name:voiceexpert/Symptoms.class
    Java-Bean:True
    I later created the jar file with the command:
    jar cfm jjj.jar Manifest.txt voiceexpert\*.*
    But, I am having the error message: "*invalid header field*".
    What can I do to remove this error?
    Note: I created the Manifest.txt using utf-8 encoding. My code is to be used in a third-party application and that is why it does not contain a main method.
    The link I was referred to could not help me. I need help please!
    Edited by: Adeyi on Feb 24, 2010 2:26 AM
    Edited by: Adeyi on Feb 24, 2010 2:34 AM

    Adeyi wrote:
    ..I created a Manifest.txt file inside c:\diagapp3 containing the following:
    Main-Class:voiceexpert.voiceexpert.Symptoms
    Note: I created the Manifest.txt using utf-8 encoding. My code is to be used in a third-party application and that is why it does not contain a main method.Why are you specifying a main-class when the API has none?
    The link I was referred to..What link? Just imagine for the moment that the Internet is a big place and we are not psychic.

  • Images in Jar files

    Hi,
    I am creating a recipe book application. Everything is exactly how I want to so I am trying to make a jar file with it.
    On the first screen that loads there is one image, when I make the jar file it doesn't seem to be able to find the image once I am outside of eclipse and running the jar.
    I have created a folder in called resources in my scr folder (src/resources) this is where I am storing the image.
    The method near the bottom (private void addPic()) is where I am having troubles.
    package recipe1_5;
    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.*;
    import java.io.*;
    import javax.imageio.*;
    import java.awt.image.*;
    * This provides an entry point into the program
    * as well as the first window
    * the main() function is at the bottom
    public class Main implements ActionListener {
         JFrame f = new JFrame();
         Container p = f.getContentPane();
         JButton newR = new JButton("Add a New Recipe");
         JButton oldR = new JButton("Look Up An Old Recipe");
         JLabel title = new JLabel("Please make a selection");
         public void actionPerformed(ActionEvent e){
              String whichButton = e.getActionCommand();
              if(whichButton.equals("Add a New Recipe")){
                   @SuppressWarnings("unused")
                   Recipe newRecipe = new Recipe();
                   f.setVisible(false);
                   f.dispose();
              if(whichButton.equals("Look Up An Old Recipe")){
                   @SuppressWarnings("unused")
                   OldRecipeChooser orc = new OldRecipeChooser();
                   f.setVisible(false);
                   f.dispose();
         }//END actionPerformed
         public Main(){
              f.setSize(200,300);
              f.setLocation(500,100);
              f.setTitle("Recipe Magic");
              p.setLayout(new FlowLayout());
              p.add(title);
              p.add(newR);
              p.add(oldR);
              newR.addActionListener(this);
              oldR.addActionListener(this);
              addPic();
              f.setVisible(true);
              f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         }//END contr ChooseWindow()
         private void addPic(){
              try{
                   String imgLocal = System.getProperty("user.dir");
                   if(System.getProperty("os.name").contains("Windows")){
                        imgLocal += "\\RecipeMagic1_5.gif";
                        JOptionPane.showMessageDialog(null, imgLocal);
                   else
                        imgLocal += "/RecipeMagic1_5.gif";
                   BufferedImage image = ImageIO.read(new File(System.getProperty("user.dir" + imgLocal)));
                   JLabel pic = new JLabel(new ImageIcon(image));
                   p.add(pic);
              catch(Exception e){
                   JOptionPane.showMessageDialog(null, "Image Load Error","ERROR", JOptionPane.ERROR_MESSAGE);
                   e.printStackTrace();
         public static void main(String args[]){
              Main m = new Main();
    }//END class ChooseWindowI have tryed this two different ways. The first how it is. And the second with something like this:
    ImageIcon ii = new ImageIcon(getClass().getResource("resources/RecipeMagic1_5"));Any insight on how to get the image from inside of the jar file would be great
    Forgot to add, it either throws a NullPointerException or a FileNotFoundException in the catch clause of addPic()
    Edited by: tyelford on Dec 15, 2010 11:46 AM

    Ok, so it works good on Mac, but if I try to use it on Windows it will not load the image,
    Here is the code that works on Mac but not windows:
    private void addPic(){
              try{
                   String imgLocal = System.getProperty("user.dir");
                   if(System.getProperty("os.name").contains("Windows")){
                        imgLocal = "resources\\RecipeMagic1_5\\RecipeMagic1_5.gif";
                   else
                        imgLocal = "resources/RecipeMagic1_5/RecipeMagic1_5.gif";
                   ImageIcon ii = new ImageIcon(getClass().getResource(imgLocal));
                   JLabel pic = new JLabel(ii);
                   p.add(pic);
              catch(Exception e){
                   JOptionPane.showMessageDialog(null, "Image Load Error","ERROR", JOptionPane.ERROR_MESSAGE);
                   e.printStackTrace();
         }I get an Image Load Error on Windows, but the same file on Mac runs perfect

  • My JAR file is not working properly!!!

    Hi everyone,
    I made an application that has a GUI (window). I converted it into a JAR file so I can send it to a friend by email. Then she can run it to generate the output. First, the user has to select a destination to save the .txt file (using JFileChooser). Then enters the inputs (using JTextFields). Clicks "Run" button (Results will be calculated and copied to the file). A Message will appear indicating that the results are copied. The problem is that when I run the application in the IDE (Eclipse) it works fine. But when I convert it into JAR, The moment I click the "Run" button, suddenly the window closes. Please HELP???
    Thank you

    DrClap wrote:
    Eng.Sh_2004 wrote:
    Sorry guys, but i would like to make things clearer, As I mentioned earlier, What i'm doing is the following: 1) Using the Jfilechooser, save the results into a filename.txt file _[main class in the manifest file (class for the GUI) ]._ 2) Click "run" to write the data to the created file in step 1 [_another class is used to write to file_]. I have a feeling that the problem is related to the manifest main class. What do you think guys?I think your description of the problem is very bad. And I think your idea of making wild guesses is a bad way of diagnosing problems.
    First of all. A JFileChooser does not save anything. It just allows the user to select a file to be saved to. So if you thought that the first step was writing anything or creating any file, you're probably wrong. But examining the code would help you understand.
    Second, if you're having problems because one class chooses the file name and a second class writes data to it, then you're probably running into the basic beginner problem we see around here all the time of how to communicate data between objects. Again, examining the code might help.
    Third, you need to understand what is writing that error message. Examining the code would help there too.
    So: stop guessing. Look at the code.I'm still New To Java that's why i find difficulty in problems diagnosis. Regarding the JAR problem, as you mentioned, I used JFileChooser to select a file and (copying data) is the other part. So I will look at the code again.
    Edited by: Eng.Sh_2004 on Aug 26, 2010 1:10 PM

  • Program not executing in jar file. Help please.

    I went through the tutorial about jars on the sun website and i created a jar file with a hello world program like this:
    "cd E:\Batch
    jar cfm test.jar m.txt test.class
    PAUSE"
    My m.txt contains this text:
    "Main-Class: test.class"
    The jar file is created. No errors.
    Then i try and run the jar with this:
    "cd E:\Batch
    java -jar test.jar
    PAUSE"
    I get "NoClassDefFoundError: test/class"
    All the dos command are run form batch files and everything is in the same directory.
    I've searched around google and this website for answers but i have failed to find anything.
    Does anyone have any suggestions i can try to fix this? I've ran out of ideas.

    Ah thats what the problem was. That was driving me
    mad thanks. So whatever you put in a jar file must be
    in a package or you can't run it.
    Message was edited by:
    JahvahNo. You can also not put it in a package, but when you specify the main-class attribute in the manifest file, be sure that you don't tell it that it is in a package.

  • Error when trying to load jar file (loadjava)

    I have been struggling with this issue for a few days. I read all the old threads and solutions online but none of them worked. I wrote some java stored procedures and have been trying to load the required jar files. The error message I keep getting is this:
    ORA-29532: Java call terminated by uncaught Java exception: oracle.aurora.server.tools.loadjava.ToolsError: Error during loadjava: Failures occurred during processing. Check trace file for details
    I have tried to load them using Enterprise Manager Console and the following:
    call dbms_java.loadjava(' -force -resolve
    c:\javacog\cognosClient.jar', ' -resolver "((* PUBLIC) (*
    SYS) )"')
    Any ideas? We are using Oracle 10gr2, and trying to load Cognos 8.3 SDK jar files. According to Cognos, Java 1.4 is supported.
    Edited by: user10406501 on Oct 8, 2008 2:26 PM

    Sorry to respond to an old message, I was just looking for the solution for the totally different problem.
    Key word 'Cognos' got me here.
    I've menage to load Cognos SDK onto Oracle 10.2.0.2 on Windows XP.
    I've used simple loadjava script. After that it requires some additional GRANTs, and it works.
    If you still are looking for the solution for this problem, respond to this message, and I'll post the scripts.
    Thomas

Maybe you are looking for