Help with javac, jar, etc.

Discussion in 'Java' started by Ryan Rushton, Jun 1, 2004.

  1. Ryan Rushton

    Ryan Rushton Guest

    I'm trying to get started with JSP development, but am having some
    problems with my Java environment. I have installed the J2EE SDK from
    Sun and have set up Tomcat 5. However, I'm having problems when I try
    to run command line operations. For example:

    C:\JSP> jar xvf jspbook3.zip
    'JAR' is not recognized as an internal or external command,
    operable program or batch file.

    I get a similar error when I try to use javac.

    Admittedly, I'm a complete novice when it comes to this stuff, so I
    may have set things up incorrectly somewhere. Can anyone point me in
    the right direction?

    Thanks,
    Ryan
     
    Ryan Rushton, Jun 1, 2004
    #1
    1. Advertising

  2. Ryan Rushton

    Roedy Green Guest

    On 1 Jun 2004 09:17:18 -0700, (Ryan Rushton)
    wrote or quoted :

    >'JAR' is not recognized as an internal or external command,
    >operable program or batch file.
    >
    >I get a similar error when I try to use javac.


    you need to add the directory where jar.exe lives you your path.

    See http://mindprod.com/jgloss/path.html
    http://mindprod.com/jgloss/jdk.html

    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
     
    Roedy Green, Jun 1, 2004
    #2
    1. Advertising

  3. Ryan Rushton

    Bryce Guest

    On 1 Jun 2004 09:17:18 -0700, (Ryan Rushton)
    wrote:

    >I'm trying to get started with JSP development, but am having some
    >problems with my Java environment. I have installed the J2EE SDK from
    >Sun and have set up Tomcat 5. However, I'm having problems when I try
    >to run command line operations. For example:
    >
    >C:\JSP> jar xvf jspbook3.zip
    >'JAR' is not recognized as an internal or external command,
    >operable program or batch file.
    >
    >I get a similar error when I try to use javac.
    >
    >Admittedly, I'm a complete novice when it comes to this stuff, so I
    >may have set things up incorrectly somewhere. Can anyone point me in
    >the right direction?
    >


    Is jar in your classpath?

    --
    now with more cowbell
     
    Bryce, Jun 1, 2004
    #3
  4. Ryan Rushton

    Bryce Guest

    On 1 Jun 2004 09:17:18 -0700, (Ryan Rushton)
    wrote:

    >I'm trying to get started with JSP development, but am having some
    >problems with my Java environment. I have installed the J2EE SDK from
    >Sun and have set up Tomcat 5. However, I'm having problems when I try
    >to run command line operations. For example:
    >
    >C:\JSP> jar xvf jspbook3.zip
    >'JAR' is not recognized as an internal or external command,
    >operable program or batch file.
    >
    >I get a similar error when I try to use javac.
    >
    >Admittedly, I'm a complete novice when it comes to this stuff, so I
    >may have set things up incorrectly somewhere. Can anyone point me in
    >the right direction?


    errr.... forget my last message. What I MEANT to ask was:

    is jar.exe in your path

    --
    now with more cowbell
     
    Bryce, Jun 1, 2004
    #4
  5. On 1 Jun 2004 09:17:18 -0700, Ryan Rushton wrote:

    > I'm trying to get started with JSP development, but am having some
    > problems with my Java environment. I have installed the J2EE SDK from
    > Sun and have set up Tomcat 5. However, I'm having problems when I try
    > to run command line operations. For example:


    I am pretty sure you also need
    the J2*SE*SDK to do command line
    compilation, make jar files..

    Though I do not know of anybody
    who has tried J2EE SDK without
    first J2*SE*SDK..

    --
    Andrew Thompson
    http://www.PhySci.org/ Open-source software suite
    http://www.PhySci.org/codes/ Web & IT Help
    http://www.1point1C.org/ Science & Technology
     
    Andrew Thompson, Jun 1, 2004
    #5
  6. Ryan Rushton

    Hal Rosser Guest

    Murach has a good book that walks you through it,
    www.murach.com
    Look for something like "Java Servlets and JSP"
    I used it as a newbie - and it walked me through with no problem.


    "Ryan Rushton" <> wrote in message
    news:...
    > I'm trying to get started with JSP development, but am having some
    > problems with my Java environment. I have installed the J2EE SDK from
    > Sun and have set up Tomcat 5. However, I'm having problems when I try
    > to run command line operations. For example:
    >
    > C:\JSP> jar xvf jspbook3.zip
    > 'JAR' is not recognized as an internal or external command,
    > operable program or batch file.
    >
    > I get a similar error when I try to use javac.
    >
    > Admittedly, I'm a complete novice when it comes to this stuff, so I
    > may have set things up incorrectly somewhere. Can anyone point me in
    > the right direction?
    >
    > Thanks,
    > Ryan



    ---
    Outgoing mail is certified Virus Free.
    Checked by AVG anti-virus system (http://www.grisoft.com).
    Version: 6.0.690 / Virus Database: 451 - Release Date: 5/22/2004
     
    Hal Rosser, Jun 1, 2004
    #6
  7. Ryan Rushton

    gajo Guest

    "Hal Rosser" <> wrote in message
    news:8H6vc.732$...
    > Murach has a good book that walks you through it,
    > www.murach.com
    > Look for something like "Java Servlets and JSP"
    > I used it as a newbie - and it walked me through with no problem.


    Or perhaps he should try "Thinking in Java" from Bruce Eckel? That was the
    book I learned from everything ;)
    Anyway, IMHO beginners should not start learning Java with complicated
    editors like Eclipse and Tomcat (AFAIK it's an editor too, not?), but a
    simple Notepad or some other simple tool that may support syntax coloring,
    but DOES NOT COMPILE AND RUN THE PROGRAM for the programmer. If the
    programmer learns to compile his program from the command line, then later
    he will have no trouble of the kind Ryan had here. Otherwise he will get
    into a situation that his applications cannot run on other computers because
    of a CLASSPATH error, and he doesn't know that and can't fix the problem.
     
    gajo, Jun 1, 2004
    #7
  8. Ryan Rushton

    Hal Rosser Guest

    TIJ is a good book, and I tried that first, but I was really impressed with
    Murach's books.
    As for the tool to use writing program - I agree he should start out using a
    text editor and command prompt.
    the next small step up is to something like JGrasp. It has a short learning
    curve, and colorizes the syntax - and lets you step through the code to
    debug.
    Eclipse and netbeans are good - but you need a month to learn how to use
    them.

    "gajo" <> wrote in message news:c9j0dc$4gs$...
    > "Hal Rosser" <> wrote in message
    > news:8H6vc.732$...
    > > Murach has a good book that walks you through it,
    > > www.murach.com
    > > Look for something like "Java Servlets and JSP"
    > > I used it as a newbie - and it walked me through with no problem.

    >
    > Or perhaps he should try "Thinking in Java" from Bruce Eckel? That was the
    > book I learned from everything ;)
    > Anyway, IMHO beginners should not start learning Java with complicated
    > editors like Eclipse and Tomcat (AFAIK it's an editor too, not?), but a
    > simple Notepad or some other simple tool that may support syntax coloring,
    > but DOES NOT COMPILE AND RUN THE PROGRAM for the programmer. If the
    > programmer learns to compile his program from the command line, then later
    > he will have no trouble of the kind Ryan had here. Otherwise he will get
    > into a situation that his applications cannot run on other computers

    because
    > of a CLASSPATH error, and he doesn't know that and can't fix the problem.
    >
    >



    ---
    Outgoing mail is certified Virus Free.
    Checked by AVG anti-virus system (http://www.grisoft.com).
    Version: 6.0.690 / Virus Database: 451 - Release Date: 5/22/2004
     
    Hal Rosser, Jun 2, 2004
    #8
  9. Ryan Rushton

    Ryan Rushton Guest

    Thanks everyone. Lots of great advice here and I can tell you it was
    much appreciated. After looking over your posts I was able to track
    down the problem. I had incorrectly set my PATH to
    "C:\Sun\AppServer\bin". I changed this to "C:\Sun\AppServer\jdk\bin"
    and now everything is working as expected. Thanks again.

    -- Ryan
     
    Ryan Rushton, Jun 2, 2004
    #9
  10. Ryan Rushton

    Bryce Guest

    On 1 Jun 2004 20:29:47 -0700, (Ryan Rushton)
    wrote:

    >Thanks everyone. Lots of great advice here and I can tell you it was
    >much appreciated. After looking over your posts I was able to track
    >down the problem. I had incorrectly set my PATH to
    >"C:\Sun\AppServer\bin". I changed this to "C:\Sun\AppServer\jdk\bin"
    >and now everything is working as expected. Thanks again.


    What I do is set an environment variable called:

    JAVA_HOME, and point it to my JDK root directory.

    Then I set my path = %JAVA_HOME%\bin

    Some java programs look for the environment variable JAVA_HOME. Also,
    enables me to switch JDKs easily.

    --
    now with more cowbell
     
    Bryce, Jun 2, 2004
    #10
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Arnold Peters
    Replies:
    0
    Views:
    632
    Arnold Peters
    Jan 5, 2005
  2. muttley
    Replies:
    0
    Views:
    2,791
    muttley
    Oct 20, 2005
  3. cyberco
    Replies:
    4
    Views:
    3,869
    Roedy Green
    Feb 14, 2006
  4. Arnold Peters
    Replies:
    0
    Views:
    701
    Arnold Peters
    Jan 5, 2005
  5. Kevin Walzer

    Re: PIL (etc etc etc) on OS X

    Kevin Walzer, Aug 1, 2008, in forum: Python
    Replies:
    4
    Views:
    451
    Fredrik Lundh
    Aug 13, 2008
Loading...

Share This Page