facebook

MyEclipse Launch java.class.path

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #639114 Reply

    jim furlong
    Participant

    I am having difficulty launching my Java App from MY Eclipse

    I used the jcmd -l command to find the PID for MyEclipse. I then used the jcmd <PID> VM.system_properties to get the complete VM properties. I was surprised to learn that java.class.path was the following

    java.class.path=C\:\\Users\\jfurlong\\AppData\\Local\\MyEclipse CI\\\\plugins/org.eclipse.equinox.launcher_1.5.200.v20180922-1751.jar

    When I run the Java App without MyEclipse and use the jcm command again, that app’s java.class.path is

    java.class.path=bin\felix.jar (note: the path is relative)

    I believe this is my problem

    How can I change java.class.path in MyEclipse to use ‘bin\felix.jar’ in addition the path MyEclipse wants?

    thank you

    #639520 Reply

    Brian Fernandes
    Moderator

    Jim,

    Normally, I would say you need to edit the launch configuration, and add the JAR you want to the Classpath tab. This doc should help.

    However, from our past interactions I know you’ve been trying a number of non-standard launches to get your application to run the way you’d like. If the above solution doesn’t work, or doesn’t apply to your case for whatever reason, could you please answer the following questions:
    1) How is felix.jar added to the classpath of your application when launching externally. How are you launching it externally – can you share the command here?
    2) How are you currently launching the application in MyEclipse? Have you customized the launch configuration in any way?

    #639526 Reply

    jim furlong
    Participant

    Brian,

    Ah, yes, we had this conversion before. I let the issue slide, but I am back at trying to solve it.

    Since speaking with you last, I had one or two successes. I was able to launch the app in question with a BAT file (see attached). All the VM properties, including the classpath, are there.

    I am also able to debug my part of the app under certain conditions. You will see I launched it enabling remote debugging and I am able to break in my stuff using Eclipse’s Remote Debugging capability. But that only happens once the program is up and running.

    What I cannot do is debug the program when it starts which means I cannot see my constructor and all the actions that take place within. IOW, Remote Debugging only works if the program is already running. I cannot start (and debug) the program as a regular Java App because I cannot get it to launch correctly from Eclipse. I believe it’s the absence of the felix jar which must be specified with a relative path.

    There is a slight subtlety here. I still need felix.jar in my build path and there I define it with an absolute path. But the app is unusual in that the jar must be relative when it launches.

    Don’t take any action on this until I try what you suggested. I simply wanted to response to you in the meantime.

    Thank you. jim

    #639534 Reply

    Brian Fernandes
    Moderator

    Jim,

    Just a quick note – the batch file didn’t come through. Could you rename it to .txt and attach? Or just email it to support@genuitec.com ATTN Brian please?

    Thanks!

    #639558 Reply

    Brian Fernandes
    Moderator

    What I cannot do is debug the program when it starts which means I cannot see my constructor and all the actions that take place within. IOW, Remote Debugging only works if the program is already running.

    Jim, I have good news – you can. I had a look at your batch file, and you have a line set JavaProperty=%javaProperty% -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,suspend=n,server=y you need to change that to set JavaProperty=%javaProperty% -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,suspend=y,server=y
    Changing suspend to y will start the JVM in suspended mode, and it will stay suspended until a debugger attaches to it. So your application will appear to have not launched at all, but it will jump to life when you start the remote debugging session from within Eclipse – you should now be able to debug all bits of the application.

    Hope this keeps you going, will wait for your updates before we investigate the Eclipse launch issues.

    #639563 Reply

    jim furlong
    Participant

    Brian,

    Your analysis was spot on. I am breaking when the program starts. Thank you and you can close this ticker. jim

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: MyEclipse Launch java.class.path

You must be logged in to post in the forum log in