Results 1 to 3 of 3
  1. #1
    rob
    rob is offline Member
    Join Date
    Feb 2009
    Posts
    14
    Rep Power
    0

    Default console applications

    Hi I need to do a console application with netbeans. Is there a way how I can run it from cmd, then, in order to get that black window (sort of like an exe of c#)?

    10x

  2. #2
    rob
    rob is offline Member
    Join Date
    Feb 2009
    Posts
    14
    Rep Power
    0

    Default

    I am trying to run just a simple helloworld from cmd and I am getting this error:

    C:\Program Files\Java\jdk1.6.0_11\bin>java Main
    Exception in thread "main" java.lang.NoClassDefFoundError: Main
    Caused by: java.lang.ClassNotFoundException: Main
    at java.net.URLClassLoader$1.run(URLClassLoader.java: 200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.j ava:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:3 07)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:2 52)
    at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:320)
    Could not find the main class: Main. Program will exit.

    Can someone help me out pls?

  3. #3
    soheil is offline Member
    Join Date
    Aug 2009
    Posts
    21
    Rep Power
    0

    Default

    try java -jar "your jar filename"! it works for me in bash shell on linux!

Similar Threads

  1. Applications in different difficulty
    By bubbless in forum New To Java
    Replies: 2
    Last Post: 03-11-2009, 01:31 AM
  2. Stand Alone Applications?
    By djpg2000 in forum New To Java
    Replies: 5
    Last Post: 09-05-2008, 08:23 PM
  3. Launching applications without an IDE
    By this_is_phil in forum New To Java
    Replies: 6
    Last Post: 05-24-2008, 08:54 AM
  4. Concurrent Applications
    By m@tqi in forum Advanced Java
    Replies: 1
    Last Post: 12-01-2007, 01:09 AM
  5. EJBs in different applications
    By Marty in forum Enterprise JavaBeans (EJB)
    Replies: 2
    Last Post: 05-27-2007, 03:21 AM

Posting Permissions

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