Problems when compiling/running java app

Discussion in 'OT Technology' started by NPH, Jun 16, 2005.

  1. NPH

    NPH Guest

    I have Sun's Java SDK and Runtine Environment installed.
    I'm using TextPad to do all my coding and stuff. When I go to compile, I get a DOS window with press any key to continue. I press it and it disappears.

    Then, when I try to run the Java Application, I get another DOS window saying "problem in main thread" something...

    I was able to compile (it would tell me errors in my code or everything good, etc) and also run the java app without any problems. Now it doesn't even do that. What could be causing this? I've uinstalled Java and TextPad and reinstalled them. Same thing.
     
  2. D1G1T4L

    D1G1T4L Active Member

    Joined:
    May 4, 2001
    Messages:
    16,489
    Likes Received:
    0
    Location:
    Bay Area
    i know this does not really answer your problem but i suggest you install eclipse and use that to write your java code/compile your code in
     
  3. Corp

    Corp OT Supporter

    Joined:
    Sep 11, 2003
    Messages:
    28,201
    Likes Received:
    0
    Location:
    Providence, RI
    make sure your tools are set up right, go to configure -> preferences -> tools and delete the three things that should be in there, Compile Java, Run Java Application, and Run Java Applet. then go to the add dropdown list and select Java SDK Commands. this should add the tools you need correctly.

    i like textpad alot more than any ide ive used, including eclipse. textpad is much faster and doesnt have a bunch of stuff i dont use anyway.
     
  4. CyberBullets

    CyberBullets I reach to the sky, and call out your name. If I c

    Joined:
    Nov 13, 2001
    Messages:
    11,865
    Likes Received:
    0
    Location:
    BC, Canada/Stockholm, Sweden
    yeah but eclipse has run-time error checking :big grin:
     
  5. P07r0457

    P07r0457 New Member

    Joined:
    Sep 20, 2004
    Messages:
    28,491
    Likes Received:
    0
    Location:
    Southern Oregon
    eclipse is a slow piece of shit.
     
  6. CyberBullets

    CyberBullets I reach to the sky, and call out your name. If I c

    Joined:
    Nov 13, 2001
    Messages:
    11,865
    Likes Received:
    0
    Location:
    BC, Canada/Stockholm, Sweden
    runs fine for me to use on my flash drive :fawk:
     
  7. P07r0457

    P07r0457 New Member

    Joined:
    Sep 20, 2004
    Messages:
    28,491
    Likes Received:
    0
    Location:
    Southern Oregon
    What does eclipse being a slow piece of shit have to do with a flash drive?

    as if it being or not being a slow piece of shit would in some what prohibit or otherwise facilitate it's use in conjunction with a flash drive? Interesting....

    :ugh:
     
  8. CyberBullets

    CyberBullets I reach to the sky, and call out your name. If I c

    Joined:
    Nov 13, 2001
    Messages:
    11,865
    Likes Received:
    0
    Location:
    BC, Canada/Stockholm, Sweden
    I was assuming you were complaining about load times... considering that is what most ppl bitch about.

    the GUI isnt even slow. I don't see why your bitching about it. All you do is bitch.
     
  9. D1G1T4L

    D1G1T4L Active Member

    Joined:
    May 4, 2001
    Messages:
    16,489
    Likes Received:
    0
    Location:
    Bay Area
    lets keep this shit positive
     
  10. kingtoad

    kingtoad OT Supporter

    Joined:
    Sep 2, 2003
    Messages:
    55,924
    Likes Received:
    11
    Location:
    Los Angeles
    In a windows environment, I prefer UltraEdit32 over that shit TextPad.
     
  11. jmechy

    jmechy Calmer then you are.

    Joined:
    Dec 29, 2004
    Messages:
    1,972
    Likes Received:
    0
    Location:
    Santa Barbara, CA
    Make a new command prompt to do your compiling in. Run - cmd, then navigate to your source and javac it (i assume that's what your doing).
     
  12. NPH

    NPH Guest


    You want me to navigate through DOS and locate the file? :ugh:
    That's so unproductive.. too much time wasted. Besides, I don't even know the command to compile once I locate the file. I've gotten TextPad to compile and run the app before, I don't know why it doesn't anymore and I get these error messages.

    I also tried netbeans, same shit. :wtc:
     
  13. kingtoad

    kingtoad OT Supporter

    Joined:
    Sep 2, 2003
    Messages:
    55,924
    Likes Received:
    11
    Location:
    Los Angeles
    Read the god damn documentation, people.
     
  14. jmechy

    jmechy Calmer then you are.

    Joined:
    Dec 29, 2004
    Messages:
    1,972
    Likes Received:
    0
    Location:
    Santa Barbara, CA
    If you can't navigate a DOS window, what are you doing with Java? learn windows first.

    http://www.microsoft.com/windowsxp/downloads/powertoys/xppowertoys.mspx
    download the "Open Command Window Here" powertoy. That gets rid of the navigating to the correct folder problem. Then, as long as you are doing normal java (not a .jar), you should be able to open a command window in your code directory, and type "javac *.java". That will compile ALL the files that end in .java in that directory.

    Oh, that also assumes you have your path and classpath set.
     
  15. kingtoad

    kingtoad OT Supporter

    Joined:
    Sep 2, 2003
    Messages:
    55,924
    Likes Received:
    11
    Location:
    Los Angeles
    :rofl: :werd:

    Good point.
     
  16. Corp

    Corp OT Supporter

    Joined:
    Sep 11, 2003
    Messages:
    28,201
    Likes Received:
    0
    Location:
    Providence, RI
    pressing ctrl+1 in textpad > using dos.
     
  17. MrMan

    MrMan New Member

    Joined:
    Jul 13, 2004
    Messages:
    308
    Likes Received:
    0
    Navigating through cmd is not that time consuming. Assuming files are in:
    C:\Documents and Settings\User\My Documents\ProjectFiles

    You can navigate quickly using wildcards *.

    cd \do*\us*\my d*\pr*

    and you're there.

    But anyway, I think something went wrong with your environments. Textpad is probably calling javac (to compile) and java (to run), but cannot find it. That's why you just try to compile using cmd first.

    [note: sourcefile = name of your file]

    To compile:
    javac sourcefile.java
    This will create a file called sourcefile.class

    To run:
    java sourcefile

    Check if this works. If it doesn't, it will be easier to narrow down your problem.
     
  18. NPH

    NPH Guest

    exactly. I'm trying to get this shit fixed. It worked before, why won't it work now? I'm not trying to get rid of the TextPad option and go through all that DOS shit. You're telling me I'm gonna have to go through all that shit every time? :ugh:

    Some of the files/exercises have to be compiled more than once to see errors and learn how to catch them as shit gets more advanced.
     
  19. NPH

    NPH Guest

    TextPad creates this .class file as well even after the error, but I get no feedback as to what errors are in the code or it's good and when attempting to run the application, I get that error in main DOS window. I'll try it regardless.
     
  20. kingtoad

    kingtoad OT Supporter

    Joined:
    Sep 2, 2003
    Messages:
    55,924
    Likes Received:
    11
    Location:
    Los Angeles
    :ugh:
     

Share This Page