Results 1 to 8 of 8
  1. #1
    eksantrik2 is offline Member
    Join Date
    Oct 2010
    Posts
    3
    Rep Power
    0

    Default how to manipulate a .class file without complex compiling

    Guys, I desperately need help here. I am not familiar with Java at all. I am trying to customize a web interface of an IP-PBX application. There is a .class file that I need to modify to proceed with the customization but I have no idea how to do it. I only need to modify a line in the file and I will upload it back into its original location. Is there a .class file editor out there for people like me.

    I am sorry if I did not provide enough information to explain my problem. I can provide more if necessary.

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

    Default

    The best way is to get the Java source file(s), modify it and then compile. If you don't have the Java source, ask for it. If you don't have rights to it, you shouldn't be modifying it.

    Much luck and welcome to the java-forums.org.

  3. #3
    eksantrik2 is offline Member
    Join Date
    Oct 2010
    Posts
    3
    Rep Power
    0

    Default

    thanks, I have the source file. (it is an open source product by the way)

    but thats all I have. I mean I can extract the jar files from the software but I will most likely get lost once I start getting into that much detail.

    Is there a way to do the compilation using only the source file? when I use javac, it gives all sorts of error messages. Is there a way to disregard those and just create the .class anyway?

    Thanks
    Last edited by eksantrik2; 10-11-2010 at 05:02 AM.

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,189
    Rep Power
    19

    Default

    when I use javac, it gives all sorts of error messages.
    Not helpful. Copy and paste the error messages verbatim -- no paraphrasing -- and someone may be able to help. No guarantees though.

    Are you aware that all dependencies must be available on the classpath both at compile time and run time?

    db

  5. #5
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,450
    Rep Power
    19

    Default

    If you're going to alter the code then I suggest checking out the project properly from their source control, otherwise you'll almost certainly spend a while trying to handle dependencies.

  6. #6
    eksantrik2 is offline Member
    Join Date
    Oct 2010
    Posts
    3
    Rep Power
    0

    Default

    The .class file I am trying to edit is called SkinControl. The following is what I am getting when I try to compile it.

    C:\Documents and Settings\Administrator\Desktop>javac SkinControl.java
    SkinControl.java:10: package org.apache.tapestry does not exist
    import org.apache.tapestry.IAsset;
    ^
    SkinControl.java:11: package org.apache.tapestry.asset does not exist
    import org.apache.tapestry.asset.AssetFactory;
    ^
    SkinControl.java:12: package org.sipfoundry.sipxconfig.components does not exist

    import org.sipfoundry.sipxconfig.components.HivemindConte xt;
    ^
    SkinControl.java:13: package org.sipfoundry.sipxconfig.components does not exist

    import org.sipfoundry.sipxconfig.components.TapestryConte xt;
    ^
    SkinControl.java:14: package org.springframework.beans.factory does not exist
    import org.springframework.beans.factory.BeanFactory;
    ^
    SkinControl.java:15: package org.springframework.beans.factory does not exist
    import org.springframework.beans.factory.BeanFactoryAware ;
    ^
    SkinControl.java:16: package org.springframework.context does not exist
    import org.springframework.context.MessageSource;
    ^
    SkinControl.java:17: package org.springframework.context does not exist
    import org.springframework.context.NoSuchMessageException ;
    ^
    SkinControl.java:20: cannot find symbol
    symbol: class BeanFactoryAware
    implements BeanFactoryAware
    ^
    SkinControl.java:54: cannot find symbol
    symbol : class IAsset
    location: class org.sipfoundry.sipxconfig.site.skin.SkinControl
    public IAsset[] getStylesheetAssets(String s)
    ^
    SkinControl.java:75: cannot find symbol
    symbol : class AssetFactory
    location: class org.sipfoundry.sipxconfig.site.skin.SkinControl
    private AssetFactory getAssetFactory()
    ^
    SkinControl.java:90: cannot find symbol
    symbol : class IAsset
    location: class org.sipfoundry.sipxconfig.site.skin.SkinControl
    public IAsset getAsset(String s)
    ^
    SkinControl.java:99: cannot find symbol
    symbol : class TapestryContext
    location: class org.sipfoundry.sipxconfig.site.skin.SkinControl
    public void setTapestryContext(TapestryContext tapestrycontext)
    ^
    SkinControl.java:125: cannot find symbol
    symbol : class BeanFactory
    location: class org.sipfoundry.sipxconfig.site.skin.SkinControl
    public void setBeanFactory(BeanFactory beanfactory)
    ^
    SkinControl.java:138: cannot find symbol
    symbol : class TapestryContext
    location: class org.sipfoundry.sipxconfig.site.skin.SkinControl
    private TapestryContext m_tapestryContext;
    ^
    SkinControl.java:141: cannot find symbol
    symbol : class MessageSource
    location: class org.sipfoundry.sipxconfig.site.skin.SkinControl
    private MessageSource m_messageSource;
    ^
    SkinControl.java:142: cannot find symbol
    symbol : class BeanFactory
    location: class org.sipfoundry.sipxconfig.site.skin.SkinControl
    private BeanFactory m_beanFactory;
    ^
    SkinControl.java:72: cannot find symbol
    symbol : class IAsset
    location: class org.sipfoundry.sipxconfig.site.skin.SkinControl
    return (IAsset[])arraylist.toArray(new IAsset[arraylist.size()]);
    ^
    SkinControl.java:72: cannot find symbol
    symbol : class IAsset
    location: class org.sipfoundry.sipxconfig.site.skin.SkinControl
    return (IAsset[])arraylist.toArray(new IAsset[arraylist.size()]);
    ^
    SkinControl.java:114: cannot find symbol
    symbol : class MessageSource
    location: class org.sipfoundry.sipxconfig.site.skin.SkinControl
    m_messageSource = (MessageSource)m_beanFactory.getBean(m_messageSour
    ceBeanId);
    ^
    SkinControl.java:119: cannot find symbol
    symbol : class NoSuchMessageException
    location: class org.sipfoundry.sipxconfig.site.skin.SkinControl
    catch(NoSuchMessageException nosuchmessageexception)
    ^
    Note: SkinControl.java uses unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    21 errors

    **********************************************

    I can definitely download all the proper files from the IP-PBX (jars etc) if it will help me to fix this.

    Thanks

  7. #7
    somanayr is offline Member
    Join Date
    May 2010
    Posts
    27
    Rep Power
    0

    Default

    That's easy. The author used some imports that your going to have to obtain. Look up the Apache Tapestry project. Then add the .jar file that you can download from the Tapestry project's website.

  8. #8
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,450
    Rep Power
    19

    Default

    Or check out the project from their source control.
    That should have everything you need so you don't have to scratch around...

Similar Threads

  1. can't write my jdbc class to manipulate mysql
    By dilanka007 in forum New To Java
    Replies: 2
    Last Post: 01-03-2010, 10:10 PM
  2. compiling .java into .class
    By khp in forum Advanced Java
    Replies: 4
    Last Post: 06-29-2009, 02:52 PM
  3. not compiling a copy of class -
    By itaipee in forum Eclipse
    Replies: 0
    Last Post: 01-07-2009, 09:47 AM
  4. Compiling a single class
    By ROSOBORONEXPORTCORP in forum New To Java
    Replies: 2
    Last Post: 01-28-2008, 12:27 PM
  5. Compiling a class in a package from cmd
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-17-2007, 10:27 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •