Results 1 to 4 of 4
Like Tree1Likes
  • 1 Post By Norm

Thread: Trouble compiling a .jar and a .bat

  1. #1
    jpiercefield is offline Member
    Join Date
    Sep 2015
    Posts
    2
    Rep Power
    0

    Default Trouble compiling a .jar and a .bat

    I'm trying to figure out the correct commands for compiling this .jar with this make file that is a .bat. I've been programming for 10 years in C, C++ so I've took this leap to learn Java and I'm already stuck on the compiling aspects which makes me feel awful about the whole Java topic ATM. Any help would be much appreciated, if you need any more information on what I'm trying to do please feel free to ask, Thanks!

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    20,003
    Rep Power
    33

    Default Re: Trouble compiling a .jar and a .bat

    Your using the wrong terminology. A jar file is built using the jar command that adds class files and other resource files to a .jar file. compiling a .java file creates a .class file.

    Can you explain again what you are trying to do?
    Is your question about how to create a make file or a .bat file?
    If you don't understand my response, don't ignore it, ask a question.

  3. #3
    jpiercefield is offline Member
    Join Date
    Sep 2015
    Posts
    2
    Rep Power
    0

    Default Re: Trouble compiling a .jar and a .bat

    Hey, Thanks for the quick reply man! @Norm

    Sorry about the terminology mix-up. Well, I'm given a .jar file and a .bat file. The instructions in a book i'm reading are, "Use the matrix package (in the jar file, don't extract the files) and the associated external documentation to solve the above system of equations. You will need to use the import statement and -classpath (or -cp) to compile and run so that you can access the classes in the jar file. You may want to consider using a batch file to speed up compiling and running with a custom classpath."

    To answer your question: I really don't understand the concept, I guess, of what I'm supposed to do with these two files in order to run them together?

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    20,003
    Rep Power
    33

    Default Re: Trouble compiling a .jar and a .bat

    The jar file you have must contain the classes for the project you are working on. If the jar file is on the classpath for the javac compile program and the java execute program then they will be able to access those class files for compiling and for executing.
    See the doc for those commands to see how to use them: Java Platform Standard Edition 8 Documentation
    There are links in the top left in blue for the javac and java commands. Follow them for your OS to see how to use them.

    Also there are links in this list of links that will be helpful: http://docs.oracle.com/javase/tutori...ybigindex.html
    Mike U likes this.
    If you don't understand my response, don't ignore it, ask a question.

Similar Threads

  1. Replies: 5
    Last Post: 11-13-2011, 03:58 PM
  2. Trouble Compiling
    By winterkid09 in forum New To Java
    Replies: 10
    Last Post: 11-22-2010, 06:26 AM
  3. Trouble compiling java files
    By winterkid09 in forum Java Applets
    Replies: 2
    Last Post: 11-21-2010, 10:25 AM
  4. compiling trouble
    By capacitator in forum CLDC and MIDP
    Replies: 4
    Last Post: 06-10-2008, 10:12 PM
  5. Trouble compiling code
    By waelhelbawi in forum New To Java
    Replies: 1
    Last Post: 05-12-2008, 04:25 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
  •