Results 1 to 4 of 4

Thread: Shell script Problem in JAVA programing

  1. #1
    Join Date
    Feb 2009
    Posts
    69

    Shell script Problem in JAVA programing

    Hey all,

    I usually code and compile using a shell like Textpad or Netbeans, but have recently been trying to feed the command line some simple commands.

    Unfortunately it responds to my Javac commands by saying:

    C:\Java\MP1>javac BgArray.java
    'javac' is not recognized as an internal or external command,operable program or batch file.

    Does anyone know how to solve this? The editor-programs have no problem compiling and running Java.

    Thanks!!

  2. #2
    Join Date
    Dec 2008
    Posts
    183

    Re: Shell script Problem in JAVA programing

    Hi, thanks for dropping by!

    This is not a web application. So you don’t need Tomcat. Just compile and run it from the command line. The readme file has commands for windows. On Unix, replace ; with : and \ with /.

    Code:
    $ javac -cp lib/smack.jar:lib/smackx.jar:lib/smackx-debug.jar ChatClient.java
    $ java -cp lib/smack.jar:lib/smackx.jar:lib/smackx-debug.jar:. ChatClient
    have put comments where you need to provide your Look at the main method of ChatClient.java.
    Hope this helps.

    PS: This is just a command line sample to get you started. There is no fancy UI.

  3. #3
    Join Date
    Dec 2008
    Posts
    93

    Re: Shell script Problem in JAVA programing

    Thanks for providing the code in your blog. it gives the good understanding of basics.

    I am facing a strange issue !!

    On running the code in my machine, I am able to chat with my userID as both sender and receiver (in console, as just echo program). However, while chatting with another are reaching the reveiver to thier replys are not displayed in my console.

    I can see the reply packets are received in the degugger window, but processMessage() of MessageListener is not getting invoked in this case.

    The same problem occurs, even with my local Openfire installed in my machine.

    Please provide me some insight on this issue.

    Thanks,

  4. #4
    Join Date
    Dec 2008
    Posts
    202

    Re: Shell script Problem in JAVA programing

    Your PATH env.var. does not include the path to javac.exe

    You can either explicitly name javac.exe

    Code:
     C:\foo\bar\> C:\j2sdk1.4.2_01\bin\javac Filename.java
    or add the path and just use javac

    Code:
     C:\foo\bar\> set PATH=%PATH%;C:\j2sdk1.4.2_01\bin
      C:\foo\bar\> javac Filename.java
    Replace C:\j2sdk1.4.2_01 with the actual path to bin\javac.exe

Similar Threads

  1. shell script SSH not working
    By Lilya in forum Software Development
    Replies: 9
    Last Post: 16-10-2010, 01:53 AM
  2. Shell script with sed
    By Ameeryan in forum Software Development
    Replies: 5
    Last Post: 23-12-2009, 02:29 PM
  3. Java Script Addition Problem
    By Magnus in forum Software Development
    Replies: 3
    Last Post: 01-06-2009, 11:38 AM
  4. Problem of shell script on Linux
    By $tatic in forum Software Development
    Replies: 4
    Last Post: 16-04-2009, 09:08 PM
  5. Unix Shell Script
    By BlackSunReyes in forum Software Development
    Replies: 3
    Last Post: 12-08-2008, 01:57 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,717,383,379.71349 seconds with 16 queries