Page 1 of 2 12 LastLast
Results 1 to 20 of 24
  1. #1
    Archeantus is offline Member
    Join Date
    May 2014
    Posts
    13
    Rep Power
    0

    Lightbulb How does eclipse run its compiled programs?

    Hey I just have a quick question. Does Eclipse use a jdk to run programs or a jre. Is there a way I can change which jre/jdk Eclipse uses to run my program?

  2. #2
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,655
    Rep Power
    5

    Default Re: How does eclipse run its compiled programs?

    Here's an interesting exercise for you. You asked two questions. Copy/paste them literally into Google. So search for

    Does Eclipse use a jdk to run programs or a jre

    and

    Is there a way I can change which jre/jdk Eclipse uses to run my program

    See what you get.

    Of course I'll answer them right here too:

    1) JRE
    2) yes of course
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  3. #3
    Archeantus is offline Member
    Join Date
    May 2014
    Posts
    13
    Rep Power
    0

    Default Re: How does eclipse run its compiled programs?

    I did a Google search already and I had even checked on eclipse's help page but couldn't find anything.

  4. #4
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,655
    Rep Power
    5

    Default Re: How does eclipse run its compiled programs?

    If the entire internet and the Eclipse manual cannot help you, I don't know what humble little old me can do.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  5. #5
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,864
    Rep Power
    8

    Default Re: How does eclipse run its compiled programs?

    You can set the JRE System Library for your project in the classpath settings.

    It needs a JRE, but that JRE can be from the JDK.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  6. #6
    kneitzel is offline Senior Member
    Join Date
    Feb 2014
    Posts
    448
    Rep Power
    1

    Default Re: How does eclipse run its compiled programs?

    Hi,

    Just my comments:
    Eclipse has a list of installed JREs that you can configure. (Window - Preferences ....)
    You can decide about the compliance level that should be used. Also found in Preferences. Be careful - that is also a Project Property!)
    SoI would recommend to check the settings of eclipse a little bit. I am sure that yoy will find a lot of interesting things (but ignorr stuff that you do not understand. Or ask if you need help.)

  7. #7
    Archeantus is offline Member
    Join Date
    May 2014
    Posts
    13
    Rep Power
    0

    Default Re: How does eclipse run its compiled programs?

    Also, how does Eclipse set up it's "special" jre. What parameters does it use to run a java program? I wanna replicate its special debugging process when it runs a program.

  8. #8
    kneitzel is offline Senior Member
    Join Date
    Feb 2014
    Posts
    448
    Rep Power
    1

    Default Re: How does eclipse run its compiled programs?

    Are you looking for this:
    Help - Eclipse Platform

  9. #9
    Archeantus is offline Member
    Join Date
    May 2014
    Posts
    13
    Rep Power
    0

    Default Re: How does eclipse run its compiled programs?

    I checked in there. It was blank (nothing in text fields). However, I'm trying to figure out why my program works in eclipse but not fully when it's compiled and running on my desktop. This is why I'm trying to recreate Eclipse's running a program thing.

  10. #10
    jim829 is online now Senior Member
    Join Date
    Jan 2013
    Location
    United States
    Posts
    3,376
    Rep Power
    5

    Default Re: How does eclipse run its compiled programs?

    You have yet to show us any code or explain what problems you are having. I suggest you provide a Short, Self Contained, Correct Example that demonstrates
    the problem.

    Regards,
    Jim
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

  11. #11
    Archeantus is offline Member
    Join Date
    May 2014
    Posts
    13
    Rep Power
    0

    Default Re: How does eclipse run its compiled programs?

    It's not the code because it works in Eclipse and kinda on my desktop. The thing is that since it works fine in eclipse I want to recreate eclipse's jre so i can run it on the desktop.

  12. #12
    jim829 is online now Senior Member
    Join Date
    Jan 2013
    Location
    United States
    Posts
    3,376
    Rep Power
    5

    Default Re: How does eclipse run its compiled programs?

    You should not have to duplicate a particular JRE to get your program to run. That's what makes Java apps portable.
    And Eclipse uses a user installed JRE to execute your program. You just need to tell Eclipse which JRE to use.
    Note: What is possible is that Eclipse is using a different version of Java than when you run it outside of Eclipse. It shouldn't
    make a difference unless you are depending on some feature which was buggy in an earlier version and then later fixed. I also know that
    the HashMap implementation doubled in size (source lines) from Java 7 to Java 8.

    Regards,
    Jim
    Last edited by jim829; 05-09-2014 at 05:02 AM.
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

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

    Default Re: How does eclipse run its compiled programs?

    What exactly isn't working?
    If. for example, there's a problem with reading from a file, or an image, then the relevant file is possibly not available when run from the desktop. Which would be a problem with how you built a jar file.

    Trying to duplicate the Eclipse environment is going to make no difference at all in that situation.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  14. #14
    Archeantus is offline Member
    Join Date
    May 2014
    Posts
    13
    Rep Power
    0

    Default Re: How does eclipse run its compiled programs?

    Okay, so here's my problem in full description. In Eclipse, my game works fine and it works like this:
    How does eclipse run its compiled programs?-javaw-2014-05-09-16-49-19-24.png
    no problems at all.
    When I compile it and run it on my desktop, it does this:
    How does eclipse run its compiled programs?-javaw-2014-05-09-16-50-04-49.png
    It doesn't draw all the stuff that I need it to.
    I don't think it has anything to do with the code. If it works in Eclipse then it should on my desktop. Need code? I'll supply any classes if needed.

  15. #15
    Archeantus is offline Member
    Join Date
    May 2014
    Posts
    13
    Rep Power
    0

    Default Re: How does eclipse run its compiled programs?

    On second thought, could it be that I use my Graphics2D class too much? Code

  16. #16
    jim829 is online now Senior Member
    Join Date
    Jan 2013
    Location
    United States
    Posts
    3,376
    Rep Power
    5

    Default Re: How does eclipse run its compiled programs?

    I'll bet its a race condition, possibly caused by thread activity within the EDT. This type of thing can happen when you try and display an image or use something within a graphics context before it is initialized. So it returns and doesn't paint anything. There maybe some latency when Eclipse starts up you program verses starting it up on the desktop.

    And the answer is no! You can't use Graphics2D too much. That would not cause the problem.

    Regards,
    Jim
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

  17. #17
    Archeantus is offline Member
    Join Date
    May 2014
    Posts
    13
    Rep Power
    0

    Default Re: How does eclipse run its compiled programs?

    So create Graphics2D instance before anything else?

  18. #18
    Archeantus is offline Member
    Join Date
    May 2014
    Posts
    13
    Rep Power
    0

    Default Re: How does eclipse run its compiled programs?

    It seems to be the

    w.loadImages();

    in the ImageWarehouse class. When I changed its place, I moved it to the place before it creates a new thread. Now it doesn't load anything nor does it do anything in the constructor.
    How should I solve this problem? Is it the way I get my images?

  19. #19
    MihirDash is offline Member
    Join Date
    May 2014
    Posts
    2
    Rep Power
    0

    Default Re: How does eclipse run its compiled programs?

    automatically eclips search the jre ,in which drive u install the java software.after finding it run it.

  20. #20
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,305
    Rep Power
    25

    Default Re: How does eclipse run its compiled programs?

    Hard to say without seeing the code? Can you make a small, complete program that compiles, executes and shows the problem?
    If you don't understand my response, don't ignore it, ask a question.

Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 18
    Last Post: 03-26-2014, 10:43 PM
  2. Need help with running programs in eclipse
    By HelloWorld1234 in forum New To Java
    Replies: 5
    Last Post: 06-12-2012, 03:49 PM
  3. Replies: 1
    Last Post: 12-07-2011, 07:39 PM
  4. Replies: 1
    Last Post: 04-27-2011, 10:08 AM
  5. Replies: 0
    Last Post: 08-04-2008, 12:17 PM

Tags for this Thread

Posting Permissions

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