Results 1 to 4 of 4
  1. #1
    McChill is offline Member
    Join Date
    Feb 2009
    Posts
    47
    Rep Power
    0

    Default Run program from desktop?

    How can I run a program from my desktop? I tried to just double click a class from my computer files but it just gives me a text document with the code or opens my Eclipse with the code. I want to be able to just double-click an icon for it and have it run.

  2. #2
    logicbug's Avatar
    logicbug is offline Member
    Join Date
    Jan 2009
    Location
    The Great White North, eh?
    Posts
    76
    Rep Power
    0

    Default

    are you sure its the compiled class and not the java file? A compiled class shouldn't open code...

    Also, you should export it from eclipse as an executable jar file. That will work much better.

  3. #3
    porchrat is offline Senior Member
    Join Date
    Mar 2009
    Posts
    105
    Rep Power
    0

    Default

    It sounds like you're attempting to run a .java file. You need to compile the java code using the 'javac' command to create a .class file.

    If I recall correctly the javac command works something like this (feel free to correct me if I'm wrong here I tend to create little scripts to do this and very rarely write it out manually):

    Java Code:
    javac -classpath .:libraries_needed_paths [name_of_.java_file]
    Last edited by porchrat; 06-23-2009 at 09:39 PM.

  4. #4
    hardwired's Avatar
    hardwired is offline Senior Member
    Join Date
    Jul 2007
    Posts
    1,576
    Rep Power
    9

Similar Threads

  1. Desktop Application - Suggestions
    By jedai in forum AWT / Swing
    Replies: 0
    Last Post: 04-26-2009, 05:43 AM
  2. Desktop Clock
    By olamide in forum Threads and Synchronization
    Replies: 1
    Last Post: 03-19-2009, 06:28 PM
  3. Spliting desktop
    By nagarte in forum AWT / Swing
    Replies: 5
    Last Post: 05-05-2008, 01:56 PM
  4. launch a desktop icon program command
    By avaj987 in forum New To Java
    Replies: 3
    Last Post: 08-03-2007, 12:40 PM
  5. k5n Desktop Calendar 0.9.0
    By levent in forum Java Software
    Replies: 0
    Last Post: 06-02-2007, 08:13 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
  •