Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Using textpad with java help !!

  • 07-01-2006 6:52pm
    #1
    Registered Users, Registered Users 2 Posts: 221 ✭✭


    I'm trying to use textpad to compile java . I'e installed j2sdk1.4.2_09 and it seems to have installed fine and it seems to complie fine but when i got ot run i get the following error message : Exception in thread "main" java.lang.NoClassDefFound Error:

    Any ideas ??


Comments

  • Registered Users, Registered Users 2 Posts: 4,188 ✭✭✭pH


    Post the code, you're probably missing a static main method.


  • Registered Users, Registered Users 2 Posts: 221 ✭✭Elfman


    Well im getting the same thing with a couple of programms so i tried this simple one :

    class myfirstjavaprog
    {
    public static void main(String args[])
    {
    System.out.println("Hello World!");
    }
    }
    the classic hello world but same reply. i tried importing java.lang but it shoul d be automatic right ? anyway didnt work.


  • Registered Users, Registered Users 2 Posts: 21,264 ✭✭✭✭Hobbes


    This is one of the most common errors (gets everyone).

    Make sure you add a dot to your classpath. eg.

    set CLASSPATH=%CLASSPATH%;.

    Then compile the java file and run it in the same directory. eg.


  • Registered Users, Registered Users 2 Posts: 221 ✭✭Elfman


    em sorry to ask the stupid question but how do i set class path ??


  • Closed Accounts Posts: 603 ✭✭✭shamrock2004


    Here you go my friend: http://www.apl.jhu.edu/~hall/java/beginner/settingup.html
    Should be everything you need regarding installation and classpath issues!
    Good luck.
    Shamrock


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 4,188 ✭✭✭pH


    That should be working fine!

    How exactly are you running this?
    The class "myfirstjavaprog" should be in a file called myfirstjavaprog.java

    to Compile:
    >javac myfirstjavaprog.java
    to Run:
    >java myfirstjavaprog

    (NOTE don't use the .class extension when using the java command to run).


Advertisement