Jar file and source code? (new to java!)

Hi all!
Sorry if this is a dumb question but I'm really new to java (.net guy).
Someone sent me a jar file and now I need access to source code. I now that I can rename to .zip and view its contents (.class)...
But what about source code? Can I decompile? As i understand, .class files are compiled .java files...
Should I ask for the source code to the guys that sent me the .jar file?
thanks
jay

Humm... is java as fast as replies in this forum? Thank's for your replies warnerja and zadok
I need the source code so that I can understand how the original developer solved a problem. I can ask for the source code.
I posted this message because I was afraid that the question was stupid and source code was in front of me. I am really new to java!
So. No source code in .jar or .class files. Right?
Thanks
Jay

Similar Messages

  • Help please - Updating .jar file and can't compile decompiled .java files.

    Ok, so there is a game on the internet called 'runescape', its a java applet that runs in the web browser from a cache in the windows directory.
    Basically im trying to edit this client so that i can run it away from their website (for use on a private server).
    The problem i am getting is that when i decompile the class files from the .jar into the .java files i can't recompile the .java files.
    E.G. I decompiled one of the .class files and tried to re-compile it agian straight away which brought me errors, i did this to rule out my editing as the problem.
    The jar file can be found [here.|http://world80.runescape.com/loader_gl397188536.jar] but the link will no double be dead after a few weeks.
    Can somebody please take a look and help me? I'm fairly new to java programming so if you could keep your answers as simple as possible that would be great, thanks.
    Ps. If this is the wrong section im sorry, i couldn't find the right section and this section seemed closest for me.

    i'm compiling using the javac command in a batch file, its displaying 100 errors but there are more, it seems to be showing that the syntax is incorrect as it is labeling brackets as being in the incorrect places.
    Decompiling error?
    As for being allowed to do this, im not so sure the company would approve but im only doing this for learning purposes and will not be releasing any of it upon the internet.

  • Making JAR file visible to code in JDeveloper

    Hi. We're using JDeveloper 9.0.5 (planning soon to upgrade to latest version) and need to get a JAR file visible to code in a Java file. The JAR file is for the Java Advanced Imaging API, JAI_WINDOWS-I586.JAR
    What do we need to do to get this working? Thank you.

    Thanks, Frank. Finally got it working. The issue was this: The JAI API has 4 different JAR files for each platform. I'd downloaded one that contained an exe; I needed the one for the CLASSPATH installation.

  • To add the JNI dll to the jar file and use the dll inside the jar file

    Hi to everybody,
    I am new to java.
    I want to add the JNI dll to the jar file and use it in the java class.
    How can I achieve it.
    Please help me.
    Thanks in advance.
    Regards,
    M.Sivadhas.

    can't be done because none of the known operating systems support reading binary libraries from .jar files ... you can add the binary to the jar but then you have to extract it...
    besides, mixing platform specific and platfrom independent components is not a very good idea, i'd keep the dll out of the jar to begin with

  • [svn:bz-trunk] 10059: update two package-info.java files, and add one new one.

    Revision: 10059
    Author:   [email protected]
    Date:     2009-09-08 11:31:48 -0700 (Tue, 08 Sep 2009)
    Log Message:
    update two package-info.java files, and add one new one.
    Modified Paths:
        blazeds/trunk/modules/proxy/src/flex/messaging/services/http/proxy/package-info.java
    Added Paths:
        blazeds/trunk/modules/core/src/flex/messaging/util/concurrent/package-info.java
        blazeds/trunk/modules/core/src/flex/messaging/validators/package-info.java

    Revision: 10059
    Author:   [email protected]
    Date:     2009-09-08 11:31:48 -0700 (Tue, 08 Sep 2009)
    Log Message:
    update two package-info.java files, and add one new one.
    Modified Paths:
        blazeds/trunk/modules/proxy/src/flex/messaging/services/http/proxy/package-info.java
    Added Paths:
        blazeds/trunk/modules/core/src/flex/messaging/util/concurrent/package-info.java
        blazeds/trunk/modules/core/src/flex/messaging/validators/package-info.java

  • How to calculates averages and send to a file?(source code)

    how to calculates averages and send to a file?(source code) I need to get started but I don't know where to begin...........the book I have doesn't really say how to handle averages and send to a file.................anybody got suggestions on how to get started? I am a newbie so place in layman's terms.............thanx

    To calculate an average: add all of the numbers together and divide by how many numbers you added together.
    ex: (1 + 2 + 3 + 10)/4 = 4 (4 is the average)
    As for writing them to a file, look over the API for random or sequential access files.

  • Jar files and JApplet

    My applet class is using other classes in my package,
    So do i need to create a jar file and specify that jar file in <applet archieve = :myjar.jar"
    I did created the jar file , but its not loading up, the browser just says Loading java applet, what might be the reason, does it depends on size of jar file?
    or my tags are wrong.
    my applet tag is
    <html>
    <applet archive = "myjar.jar"
    code = "front.class"
    width.. >
    the front.class file is also in myjar.jar.
    Any help....
    Also one more question,
    Can i call other applets within one applet class.
    I have a gui, when a particular button is clicked on applet
    i want to go to other applet, so how should i call it in that buttons action listner?
    And in my applet class i am using one other class from my package which actually coonects to databse through JDBC. now say i have a button on my applet whihc says "Connect", and when that button is clicked then I created object of my other class which makes connection
    through databse. So will this work from applet?
    Thanks

    my applet tag is
    <html>
    <applet archive = "myjar.jar"
    code = "front.class"
    width.. >Just to get you started - if it is a JApplet, not an Applet, then you need to use different HTML tags, otherwise it won't work. If you have JDK1.3, look in the /bin directory - you should see a file called "HTMLConverter.bat" if it's there, cd to the directory where your HTML file is, and type
    "HTMLConverter wateverYourHTMLPageIsCalled.htm"
    (case sensitive - and remember to check whether its called ".htm" or ".html")
    When it has executed successfully, look at the source of your html - it should be different (<OBJECT> tags and lots of other stuff)
    If you have an older version of the JDK, or don't have HTMLConverter.bat, you can download it from Sun's website.
    Now you should be able to run your applet...
    >
    Can i call other applets within one applet class.
    If you use "getAppletContext().showDocument(URL url)", this will replace the current html page with the new one - is that what you mean?
    And in my applet class i am using one other class from my package which actually
    coonects to databse through JDBC. now say i have a button on my applet
    whihc says "Connect", and when that button is clicked then I created object
    of my other class which makes connectionthrough databse.
    So will this work from applet?Should do :-)

  • JAR files and getResource()

    Hello i have the following piece of code in class x.y.z.Tester:
    String rootPath = this.getClass().getResource("/").getPath();          
    System.out.println(rootPath);which prints the path where the x.y.z.Tester class is located on my FS.
    for example if my class is store at:
    C/folder_1/bin/x/y/z/Tester.class
    the returned path would be:
    C:/folder_1/bin
    Now, when I bundle this class (along with others) in a JAR file and set the x.y.z.Tester as the main class and run it, i get this error:
    Exception in thread "main" java.lang.NullPointerException
    at com.nortelnetworks.productsupportability.netrx.service.report.generator.Tester.<init>(Tester.java:9)
    at com.nortelnetworks.productsupportability.netrx.service.report.generator.Tester.main(Tester.java:35)
    On line 9 is the first line of code above.
    On line 35 is the call to the method that has line 9.
    However, the funny thing is that when I unzip (or extract) the contents of my JAR file, the it works fine and returns the path where the x.y.z.Tester is stored.
    Now, I would like to have this work without having to unzip the JAR file. does anyone know if any issues or why the "getResource()" method returns a NullPointerException if it's JAR'ed.
    thank you,

    Not sure what your goal is, but try this.
    import java.net.URL;
    import java.security.CodeSource;
    import java.security.ProtectionDomain;
    public class CodeSourceExample {
        public static void main(String[] args) {
            CodeSourceExample object = new CodeSourceExample();
            Class cls = object.getClass();
            ProtectionDomain domain = cls.getProtectionDomain();
            CodeSource source = domain.getCodeSource();
            URL location = source.getLocation();
            System.out.println(location);
    }

  • Decompiling jar file and then run

    Dear Members,
    I have a jar file and I have decompiled that jar file and converted into class file,
    now I want to run/edit using source code ,I am unable to run source code with out put whatever coming in jar file running,
    I am trying with class in which
    public static void main(String[] args)
    function defined,
    I am using Jcreater1.5 and from command prompt also running but unable to run and edit the programm,
    how to run these class file in complete project that output will come as running jar file
    regards
    SACHIN

    It sounds like you have unpacked the jar.
    To edit the source you need to decompile the classes to .java files.
    [http://www.google.co.uk/search?q=java+decompiler]

  • How to include .jar files in coldfusion code 

    To Integrate our cfm code with paypal jar files we do the
    following steps with our local coldfusion server ,and to run and
    integrate the paypal Java SDK jar files, I think we need to do the
    same process on the server, can you suggest any thing to do the
    following setting for my domain on the server, without setting the
    class path in coldfusion administrator.
    The ColdFusion application server must be configured to know
    the location of the PayPal JAR
    files, and your ColdFusion Markup (CFM) pages must be
    configured with the absolute path to
    the PayPal API certificate for the PayPal API user on whose
    behalf the calls are made.
    1. Install the PayPal Java SDK “Installing the
    SDK”.
    2. Copy a subset of the Java SDK JAR files to a location
    accessible by the ColdFusion
    application server. The JAR files are in SDK_root\lib and
    their exact names are as
    follows:
    – bcmail-jdk14-128.jar
    – bcprov-jdk14-128.jar
    – paypal_base.jar
    – paypal_stubs.jar
    sax2.jar
    – xerces.jar
    – xpp3-1.1.3.4d_b4_min.jar
    – xstream.jar-1.1.3.jar
    3. With the ColdFusion Application Server Administrator, add
    the absolute path of the
    location you determined in Step 2 to the Java and JVM
    CLASSPATH environment variable.
    4. Restart the ColdFusion Application Server.
    Suggest me how to include .jar files without setting
    classpath.

    > Suggest me how to include .jar files without setting
    classpath.
    Copy them to {CF_HOME}\lib, where {CF_HOME} is, for example,
    C:\CFusionMX7. Restart Coldfusion.

  • JAR files and J2ME

    Just starting a J2ME project.
    An embarrassingly Noobie Question:
    1) All the classes that are supposedly "built-in" to my device (phone)
    do NOT need to be included in the deployed JAR file, right?
    2) Anyone know how to do that in Netbeans 5.0?
    Project -> Properties -> Build shows sources filtering
    but that doesn't include anything from my "input"/library .JARS.
    However, all the com.*, javax.* and java.* files are being included in
    my output JAR file and it causes failures in preverify and loading
    on the phone.
    HELP!!

    hi,
    any know this question
    please send me the procedures about how load my J2ME
    application(jad and jar file) into CDMA mobiles
    like(Nokia 6255,6235,6235i etc..).
    its very urgent for me,
    please anybody known this answer reply very soon.
    thanks a lot
    laxmi.Hi
    I am also having the same problem , any one has found solutions kindly inform. I want to install the spreadsheet viewer. Has any body developed solutions for the same - Please help
    Thanks a lot
    Ragupathi

  • Conversion of class files to source codes

    I was informed that it is possible to convert class files back to the java sourcs codes from where those are generated. How can I protect my source codes from illegal copying by others ?

    hai ,
    yes it is possible to convert class file into source code. there is a software called jad.exe available in the net
    using witch u can convert class file into jar file. but i don't know how to protect the class file to avoid the illigal convertion.

  • How to Add JAR files and Config files to CLASSPATH at runtime?

    QUERY:
    During runtime, I need to load the JAR files and relevant config files( .cfg files and .properties file) into CLASSPATH and run a specific java program from one of the JAR which is available in CLASSPATH.
    Please advise me any relevant Java API details or a sample java program to implement the above use case.
    Thanks in advance.

    During runtime, I need to load the JAR files and relevant config files( .cfg files and .properties file) into CLASSPATH and run a specific java program from one of the JAR which is available in CLASSPATH.
    Please advise me any relevant Java API details or a sample java program to implement the above use case.
    You don't add to YOUR classpath once your app is launched.
    You create a NEW process for the app you want to run and provide the proper environment for it to run in - including any PATH or CLASSPATH environment variables.
    The Java API for the ProcessBuilder class has a simple example that shows how to create the arguments and launch an external application.
    ProcessBuilder (Java Platform SE 7 )
    There are also PLENTY of other examples of using ProcessBuilder; just search the net.

  • Jar files and applet

    My applet class is using other classes in my package,
    So do i need to create a jar file and specify that jar file in <applet archieve = :myjar.jar"
    I did created the jar file , but its not loading up, the browser just says Loading java applet, what might be the reason, does it depends on size of jar file?
    or my tags are wrong.
    my applet tag is
    <html>
    <applet archive = "myjar.jar"
    code = "front.class"
    width.. >
    the front.class file is also in myjar.jar.
    Any help....
    Also one more question,
    Can i call other applets within one applet class.
    I have a gui, when a particular button is clicked on applet
    i want to go to other applet, so how should i call it in that buttons action listner?
    And in my applet class i am using one other class from my package which actually coonects to databse through JDBC. now say i have a button on my applet whihc says "Connect", and when that button is clicked then I created object of my other class which makes connection
    through databse. So will this work from applet?
    Thanks

    You didn't show all of your applet tag, but it should look like this:
    <HTML>
    <APPLET CODE = front.class, ARCHIVE = myjar.jar, width = ???, height = ???>
    </APPLET>
    </HTML>
    Assuming your applet is not crashing, this should load it. I recommend using the appletviewer tool in the JDK, it provides more detailed error messages. I hope this works for you.
    Now inter-applet communication. This is forbidden, sorry. However, if you really want to get fancy; remember that all applets can communicate back to the host from which they came. So if you want to build a small server on your host machine which all your applets log into, they can then communicate with each other through the server.

  • Executable jar files and manifest file

    Hi,
    I have the following files in a folder named: Test
    a.jar
    b.jar
    c.jar
    Driver.class
    Driver.mf
    Here, MainClass is the main executable class that uses a,band c.jar files. This is how my MainClass.mf file looks:
    Manifest-Version: 1.0
    Main-Class: Driver
    Class-Path: a.jar b.jar c.jar
    Now I use the following command to make one executable jar file:
    jar cmf Driver.mf DriverMain.jar *
    It creates an executable jar file named : DriverMain.jar
    Now I copy the executable jar file (DriverMain.jar) into a different folder named: RunTest
    and double click it, doesn't work.
    my question is:
    what am I doing wrong? Any special characters needed in my Driver.mf file (space/newline/etc)?
    What I am trying to get is: One execuatble jar file so I can just double click to run it, and that single executable jar file will have all the necessary jars in it (i.e. a.jar, b.jar, c.jar in this case)
    Anyone please help!
    Thanks
    -Ron

    Rony,
    Sorry to disappoint, but you can not use embeded jar/zip files within an executable jar. The JDK sadly for some reason decided this was not a useful idea, so developers like me who want to distribute plugins with thier own dependencies have one of two choices. You either have to unzip the jar file that contains the embeded jars to a directory, then run your primary exectuable jar, OR you have to write a custom classloader that your "launcher" creates then loads the embeded jar files.
    The best thing to do is either jar up a, b, c and driver into one jar, so that it works, if you can legally do this. A lot of 3rd party libraries may not allow this per their license. Otherwise, another choice is to use a free installer or buy an installer that allows you to distribute a single exectuable installer program that will properly create the dir structure you need.
    As for the way it works, if you declare:
    Class-Path: a.jar b.jar c.jar
    the JAR loader code in the JDK looks in the root dir where your application was started for a/b/c jar files. They have to be on disk.
    If you want to place them in /lib, for example, you would havd a jar file like:
    Driver.class
    Driver.mf
    lib/a.jar
    lib/b.jar
    lib/c.jar
    When unzipped, your "root" dir would look exactly like the above, and your manifest would have Class-Path using ./lib/a.jar ./lib/b.jar ./lib/c.jar
    Anyway, there thus far isn't any way around this issue of embeding jar files in an executable jar file. You MIGHT be able to not specify any classpath, then in your Driver.class, create a new custom classloader that dervies from URLClassLoader, but in the findClass(), you get a ref to the .jar file that the classloader class is inside of, and from that use it to find the lib/*.jar files and add them to the classpath. For this to work, however, your Driver.class code should ALSO be contained in an embeded jar file that is loaded by this custom loader. The only thing Driver.class would contain (and I would rename it to something like Launcher) is the code to create the custom classloader.
    It's fun stuff, but a little bit of work to make it work. You can infact make it work! I may yet one day take our plugin engine custom loader and create a way for this to work!

Maybe you are looking for

  • Can I run Adobe Acrobat 6 pro and Reader X

    I continue to use Adobe Acrobat 6 Professional for its ability to combine documents, and insert and delete pages in PDFs.  If I download and install Adobe Reader X, will it overwrite Acrobat 6 Pro, rendering it useless?  I realize that 6 Pro if very

  • Query using analytics function in SQL

    Hello, I have a situation here .. kindly guide me.. There are 2 tables, Case table (summary table) and Task table (detailed table) The structure of tables: Case Table: Case_ID, Trans_CT, à(transaction count could be 1,2,3 ..any numeric  value) Case_R

  • Sun PKCS#11 NSS Problem with CA Certificates

    There appears to be a problem with the Sun PKCS#11 provider's NSS specific functionality. If Firefox 2.x based KeyStore is loaded which contains CA Certificates which have been imported into the the standard "Software Security Device" (and are theref

  • Prototype n95

    i just picked this up on All About Symbian. http://www.allaboutsymbian.com/forum/showthread.php?t=74989 seems someone has offloaded an prototype n95. maybe nokia would be interested in thier security or are they actually selling these now? I'd rather

  • Premiere Elements 9 Will Not Run

    I have tried installing it several times but running  into the same issue: PRE9 will only open as far as the dialog box to set  new project name.  Somehow the software will not respond to any keyboard  or mouse commands at that dialog box except to m