- This topic has 3 replies, 2 voices, and was last updated 5 years, 2 months ago by Brian Fernandes.
-
AuthorPosts
-
jim furlongParticipantI am attempting to debug a jar that runs in a larger project. I am using ME CI. The project lives in an OSGi framework and one starts it from the Main class in the jar ‘felix.jar’ (org.apache.felix.main.Main).
In order for my jar to compile I must define a classpath with MyEclipse’s Java Build Path. I include the felix jar since it has the main class that I must start the application with. The class paths in Java Build Path are absolute (i.e. c:\myproject\bin\jar1, c:\myproject\bin\jar2, etc.) but felix Main wants only the relative path (i.e. bin\felix.jar). Otherwise, it cannot find its configuration file
I have tried overriding the debugging VM parameters for classpath several ways:
1) -classpath bin\felix.jar
2) -Djava.class.path=bin\felix.jar and to this forum’s topic
3) by defining ${project_classpath:bin\felix.jar}The 3rd approach resulted with the “Problem Occurred” during launch with Topic Title (above) given as the reason. The popup dialog is in the attachment.
My questions are:
1) how to I get control of the classpath when I setup my debugging or running configurations (i.e. override what MyEclipse is using)?
and
2) what does “Path for project must have only one segment” mean?Thank you
Attachments:
You must be logged in to view attached files.
Brian FernandesModeratorJim,
We’d need a few more details to be able to assist here. One note is that this appears to be more of a base Eclipse question as opposed to a MyEclipse issue, but we will do our best to assist. Still, you might also find help over at the Eclipse forums, like onthis thread which talks about something similar with a CDT launch.
1) Can you tell me exactly how your are launching the application? What sort of configuration are you using – is it an
OSGI Framework
launch, aJava Application
launch or something else? Sending a screenshot(s) of the configuration settings (with all relevant pages) will help us get a much better idea of how you’ve set it up.2) As I’ve understood it, you’re planning to launch the larger application in debug mode to debug the JAR in question within, correct? Or are you thinking of debugging the smaller JAR directly in some way? (not sure if it can function and be tested independently outside the larger app).
If you can clarify these points, we should be able to provide further assistance on how to move on, and the questions you’ve asked.
jim furlongParticipantBrian,
At the moment I have solved my problem by launching my APP with a BAT file that starts the Java VM, sets the VM properties for remote debugging(i.e set JavaProperty=%javaProperty% -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,suspend=n,server=y) and uses the “Remote Java Application” tool in the “Create, Manage and Run Configurations” window. This works because the code I want to debug doesn’t get called until after the APP has initialized.I start the BAT from the root directory of the APP and the BAT file allows me to “set CLASSPATH1=bin\felix.jar,” which is the only jar needed. For reasons only Apache can explain, if an absolute path is used to define the felix jar (which is what happens when I try to start felix as a Java App in MyEclipse) felix main cannot find the OSGI configuration file. I have attached the BAT file for your information, but I would not spend any more time on this.
In retrospect, I should have built this project as an OSGI one. But I thought I could start it as a simple Java App and that did not work.
Thank you for your hard work. jim
Brian FernandesModeratorJim,
Thank you for the detailed response. The batch file did not come through, but I have a suggestion that might help you get rid of it.
If you create a
Java Application
launch configuration, on the Classpath tab, you can remove all entries, so the the “Bootstrap Entries” and “User Entries” nodes are empty. This will prevent the launch from generating a classpath switch. You can confirm this by clicking the, “Show command line” button after applying the above change. You can now go to the Environment tab and set theCLASSPATH
variable like you were doing in the batch file. The program and VM arguments would go in the appropriate fields of the Arguments tab, of course.Hope this helps!
-
AuthorPosts