Results 1 to 7 of 7
  1. #1
    bakriawad is offline Member
    Join Date
    Apr 2013
    Posts
    22
    Rep Power
    0

    Default Creating an executable file - Eclipse

    Hello

    i have finaly finished a program (game) i have been working on, then when the time to export the game came i got K.Oed since none of my tries worked neither some websites...
    i could not make an runnable jar file that opens the game.. so please help

    i have never tried to do such a thing before so this is my 1st time, i do not have classes in my project, and was not able to make any so if you tell me how to do that too it would be nice.

    i want to know how to:
    1) create .class file (build) and execute using batch
    2) create a stand alone file that can be opened from any machine* without the need of resources (or with - both) to be with the file, so resources should be embed within the executable file.

    *- i do know that you need JRE to run.
    details would be nice but not too much, ill research the rest, also more ways than i mentioned before would defiantly help me if you can add any.

  2. #2
    monkeyjr97 is offline Senior Member
    Join Date
    Nov 2012
    Posts
    258
    Rep Power
    2

    Default Re: Creating an executable file - Eclipse

    You have a Java application without any Class?

    say what?

  3. #3
    bakriawad is offline Member
    Join Date
    Apr 2013
    Posts
    22
    Rep Power
    0

    Default Re: Creating an executable file - Eclipse

    its in the compiler... obviously u wont need a .class file to run since the compiler just compiles the .java and runs it

  4. #4
    monkeyjr97 is offline Senior Member
    Join Date
    Nov 2012
    Posts
    258
    Rep Power
    2

    Default Re: Creating an executable file - Eclipse

    ah i miss read, i thought you had no Classes in you Java application sorry man!

    to get .class files, just create a new project in Eclipse or net beans w.e and copy your java files in, build the project export as file system then you can copy the class files created into your original project.

  5. #5
    bakriawad is offline Member
    Join Date
    Apr 2013
    Posts
    22
    Rep Power
    0

    Default Re: Creating an executable file - Eclipse

    well jar does not run, so i ran it using CMD and found out there is an error in importing an image.. however there is no problem when i run it in the compiler...

    i have selected the option that makes it export resources and the images do exist in the .jar file.
    tried including "\\" before the name of the image in the Source Code yet no luck...

    the images are in the same folder as the classes in both compiler and .jar file

    any ideas?

  6. #6
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,792
    Rep Power
    19

    Default Re: Creating an executable file - Eclipse

    How are you loading the image?
    If it is in the jar file then you have to load it using getResource or getResourceAsStream.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  7. #7
    allaudin's Avatar
    allaudin is offline Senior Member
    Join Date
    Apr 2013
    Posts
    271
    Rep Power
    0

    Default Re: Creating an executable file - Eclipse

    write your code so that everyone can understand better ..

Similar Threads

  1. Creating Jar file with eclipse
    By Danieldcc in forum New To Java
    Replies: 5
    Last Post: 04-27-2012, 05:29 AM
  2. Creating executable jar file in Eclipse
    By N00Bie in forum New To Java
    Replies: 25
    Last Post: 06-18-2011, 03:43 AM
  3. create windows executable using executable jar file
    By sarwar1234 in forum New To Java
    Replies: 2
    Last Post: 02-07-2011, 08:29 PM
  4. Eclipse and creating .jar file
    By wantakill in forum Eclipse
    Replies: 11
    Last Post: 09-04-2010, 11:51 PM
  5. Creating an executable jar file in IntelliJ IDEA
    By turanan in forum IntelliJ IDEA
    Replies: 0
    Last Post: 12-04-2009, 03:06 PM

Posting Permissions

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