Page 1 of 2 12 Last
  • Jump to page:
    #1
  1. No Profile Picture
    =) wannabe?
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jul 2002
    Location
    florida
    Posts
    2,153
    Rep Power
    15

    compiling a class. and putting it in the class path


    i was following a tutorial. and got to form processing.

    there it told me to make a class.

    then:

    "Once you have defined the class, compile it and make sure it is available in the web-server's classpath. The server may also define special folders where you can place bean classes, e.g. with Blazix you can place them in the "classes" folder. If you have to change the classpath, the web-server would need to be stopped and restarted if it is already running."

    but how do i compile it? what do i even save the class file as and where's that "classes" folder. i'm on a shared host.

    if you could help

    thank you
  2. #2
  3. Introspective
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Nov 2001
    Location
    London, UK
    Posts
    3,317
    Rep Power
    111
    Do you have a shell account on your host machine?
    If so, (and assuming it's a *nix varient) you can check your paths with

    echo $PATH
    echo $CLASSPATH

    you can then navigate to your project directory and add it to your classpath with

    prompt>export CLASSPATH=$CLASSPATH:`pwd`

    or you can preserve this setting by editing your .bashrc file.

    javac should be somewhere within your executable path too, so you can compile your .java files into .class files. You can also tidy your classes up by using jar (which works just like UNIX's tar)

    Any help? or have I missed the point?

    christo
    This is me: http://chris.uk.com
  4. #3
  5. No Profile Picture
    =) wannabe?
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jul 2002
    Location
    florida
    Posts
    2,153
    Rep Power
    15
    nope. u got everything covered, i think =).

    thanks a lot.

    it'll take sometime to figure out

    thanks again
  6. #4
  7. Introspective
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Nov 2001
    Location
    London, UK
    Posts
    3,317
    Rep Power
    111
    aah okay - hit me back if you run into more probs


    christo
    This is me: http://chris.uk.com
  8. #5
  9. No Profile Picture
    =) wannabe?
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jul 2002
    Location
    florida
    Posts
    2,153
    Rep Power
    15
    if i do echo $PATH i get some path.

    if i do echo $CLASSPATH i get undefined variable CLASSPATH.

    then if i try export CLASSPATH=$CLASSPATH:`pwd`
    i get bad modifier (`)
    i tried putting ' and ". i just get bad modifier (') or (")

    i tried removing the :`pwd` part. then i get unknown command export.

    i'm a complete noob to this
  10. #6
  11. Introspective
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Nov 2001
    Location
    London, UK
    Posts
    3,317
    Rep Power
    111
    can you tell me the output of

    echo $SHELL


    christo
    This is me: http://chris.uk.com
  12. #7
  13. Introspective
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Nov 2001
    Location
    London, UK
    Posts
    3,317
    Rep Power
    111
    aaah I can see what it is

    `pwd`
    ^--------------that's not a single quote. It's a backtick operator (the key above your tab key on a standard keybo)

    should fix it

    christo
    This is me: http://chris.uk.com
  14. #8
  15. No Profile Picture
    =) wannabe?
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jul 2002
    Location
    florida
    Posts
    2,153
    Rep Power
    15
    nope i tried that

    the only thing that happene is i have export file in my root dir. it was 0 bytes.

    echo $SHELL outputs /bin/csh
  16. #9
  17. Introspective
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Nov 2001
    Location
    London, UK
    Posts
    3,317
    Rep Power
    111
    c-shell has a different syntax - sorry bout that. I assumed you were in bash.

    Anyway, change that line to something like:

    setenv CLASSPATH `pwd`

    which should initlalize the classpath variable and assgn your current path to it.

    if the output of echo $CLASSPATH then looks okay, you can add that same line into your .cshrc file, but change `pwd` to be the path of your project directory.


    christo
    This is me: http://chris.uk.com
  18. #10
  19. No Profile Picture
    =) wannabe?
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jul 2002
    Location
    florida
    Posts
    2,153
    Rep Power
    15
    yep that worked =) thanks a lot!.

    now i need to learn how to get from one dir to another. so the class path isn't /home/wannabe. but google can help me with that

    =) thanks a lot!. i couldnt' find anything on google on this. thought it was hopeless =)
  20. #11
  21. Introspective
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Nov 2001
    Location
    London, UK
    Posts
    3,317
    Rep Power
    111
    cool

    if you get stuck with the shell commands, just take it over to the UNIX forum..

    good luck

    christo
    This is me: http://chris.uk.com
  22. #12
  23. No Profile Picture
    =) wannabe?
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jul 2002
    Location
    florida
    Posts
    2,153
    Rep Power
    15
    hi again.

    i cant get javac to work.

    if i do

    javac formdata.java

    i get

    ELF binary type "0" not known.
    /usr/local/bin/javac: Exec format error. Binary file not executable.

    i did what this page told me to do

    http://suif.stanford.edu/~courses/cs...ava_intro.html
  24. #13
  25. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jan 2003
    Location
    No es importante
    Posts
    2,065
    Rep Power
    14
    Wannabe here is some info for you.
    Q: When I try to run a command, I get the error message "Exec format error. Binary file not executable". What does this mean?
    A: This very likely means that you are trying to run a Solaris binary on a Linux based computer, or likewise it could mean you are trying to run a Linux binary on a Solaris based computer. Most likely, the program you are trying to run is in your home directory or possible the CSSU's directory. In any event, it's not going to work, and you need to find a version of the program that is appropriate for the platform you are working on.

    The whole article can be found at:
    http://www.cdf.toronto.edu/cdf/linuxfaq.html#USING4
  26. #14
  27. No Profile Picture
    =) wannabe?
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jul 2002
    Location
    florida
    Posts
    2,153
    Rep Power
    15
    i've no idea what that means

    i type a file save it as .java then do javac file.java and i get that error
  28. #15
  29. No Profile Picture
    =) wannabe?
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jul 2002
    Location
    florida
    Posts
    2,153
    Rep Power
    15
    i dont even know what solaris is. besides that it's an os
Page 1 of 2 12 Last
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo