Results 1 to 18 of 18

Thread: Helpless...

  1. #1

    Thread Starter
    Hyperactive Member Jareware's Avatar
    Join Date
    Nov 2000
    Location
    Silicon Valley, CA
    Posts
    275

    Unhappy

    I just downloaded the java 2 sdk newest version.

    I know how to write simple applets but how do I compile them?


    -JR-

  2. #2
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    Im pretty sure that that an applet is compiled the same
    as a normal .java source file... since an applet is still
    a class.

    If you dont hava FORTE or some other IDE then you
    would goto DOS and compile from the command line ie...
    C:\ javac -classpath C:\Java\myclasses; myapplet

    if you dont have the classpath set in your autoexec.bat then the -classpath option is nessary to tell java where
    to look for your classes.

  3. #3

    Thread Starter
    Hyperactive Member Jareware's Avatar
    Join Date
    Nov 2000
    Location
    Silicon Valley, CA
    Posts
    275
    Ooookaay...


    -JR-

  4. #4

  5. #5

    Thread Starter
    Hyperactive Member Jareware's Avatar
    Join Date
    Nov 2000
    Location
    Silicon Valley, CA
    Posts
    275
    I think I'll hang on with VB for a little while and do my java @ school where people who know a little more about stuff have made everything simple enough for me to use them ...


    -JR-

  6. #6
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    Yeah Java is cool but to do anything Graphical it is a pain in the ass. I stuck with VB for a while then went into VBA programming for Access which is interesting.
    Well gotta go do some drinking..... check you later
    Good Luck.....

  7. #7

    Thread Starter
    Hyperactive Member Jareware's Avatar
    Join Date
    Nov 2000
    Location
    Silicon Valley, CA
    Posts
    275
    Hey buddy still following this thread?

    (Could use some help )


    -JR-
    "Blessed are we who can laugh at ourselves for we shall never cease to be amused"
    - Unknown

  8. #8
    Guest

    Thumbs up

    What goal are you trying to accomplish?
    What are you doing to accomplish this goal?
    What is the result?

    Perhaps this should have had the ".java" extension:
    C:\javac -classpath C:\Java\myclasses; myapplet.java

    Dilenger4 was saying that you might be able to get away with:
    C:\javac YourAppletClassName.java
    if your classpath is set correctly, if not, add the "-classpath" option.

    I've never tried this with the semicolon
    C:\javac -classpath C:\Java\myclasses; myapplet.java
    but I don't think that would be a problem.

  9. #9

    Thread Starter
    Hyperactive Member Jareware's Avatar
    Join Date
    Nov 2000
    Location
    Silicon Valley, CA
    Posts
    275
    Ahem, please, I'm a mortal ...

    But what should I do to get that classpath to be a default or something?


    -JR-
    "Blessed are we who can laugh at ourselves for we shall never cease to be amused"
    - Unknown

  10. #10
    Guest

    Thumbs up

    Check http://forums.vb-world.net/showthrea...threadid=60522 for some ways. I liked Dilenger4's technique.

  11. #11

    Thread Starter
    Hyperactive Member Jareware's Avatar
    Join Date
    Nov 2000
    Location
    Silicon Valley, CA
    Posts
    275
    Yes, I actually took a look at that before posting, and doesn't it have to do just with calling the class file from an html one?


    -JR-
    "Blessed are we who can laugh at ourselves for we shall never cease to be amused"
    - Unknown

  12. #12
    Guest

    Question

    If set in general, then I believe any application that desires to use the "classpath" variable will have that available to it.

    I think you should repost your question. (In this thread or a new one). I don't know what you need at this time.

  13. #13

    Thread Starter
    Hyperactive Member Jareware's Avatar
    Join Date
    Nov 2000
    Location
    Silicon Valley, CA
    Posts
    275
    When I am in the directory in which the .java file is and I say (on windows 2000 command prompt):
    Code:
    javac ArcTest.java
    It gives me an error saying:
    Code:
    Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/tools/javac/Main
    -JR-
    "Blessed are we who can laugh at ourselves for we shall never cease to be amused"
    - Unknown

  14. #14
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    Try compiling from the bin. That is where the javac compiler can be found... So at the DOS prompt i usually
    change directories to C:\jdk1.3\bin
    then i type in javac C:\Java\myclassname.java
    if you notice the Java is just a user defined directory
    where i put my stuff.

  15. #15

    Thread Starter
    Hyperactive Member Jareware's Avatar
    Join Date
    Nov 2000
    Location
    Silicon Valley, CA
    Posts
    275
    Wow, thanks bud, it's working now!

    Not to whine, but is it possible for a beginner to "globalize" the classpath (i.e. you don't have to go to the bin dir every time you compile)?


    -JR-
    "Blessed are we who can laugh at ourselves for we shall never cease to be amused"
    - Unknown

  16. #16
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    Yes you can set your class path globally. But i dont think that will allow you to compile from another directory
    besides the bin. If you set your classpath locally you
    can omit the -classpath option at runtime though.
    ie java -classpath C:\Java; Myclassname

  17. #17

    Thread Starter
    Hyperactive Member Jareware's Avatar
    Join Date
    Nov 2000
    Location
    Silicon Valley, CA
    Posts
    275
    OK, thanks,


    -JR-
    "Blessed are we who can laugh at ourselves for we shall never cease to be amused"
    - Unknown

  18. #18
    Guest

    Thumbs up

    Yes you can set your PATH globally as well as your CLASSPATH.

    The PATH tells your operating system where to search for javac.exe and java.exe (actually any program that you "request to launch" off of the command line), the CLASSPATH tells javac.exe where to find other *.class files.

    Maybe something like:
    PATH = %PATH%;c:\jdk1.3\bin

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width