Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 247
  • Last Modified:

How to debug JAVA code in Eclipse by setting input variables permenantly?

Hi,
I have a Java code and I want to debug it in Eclipse.

I call this Java code from a Perl code normally. So there are some input arguments to Java code from Perl.

What I want to do is to set these input parameters somewhere in Eclipse as parameters and run the Java code in debug mode in Eclipse.

How can I do it?

Note: Normally I create a jar file from my Java code by saying java -jar  .... I believe this will not change anything but I wanted to mention it just in case.


Thanks,
0
Tolgar
Asked:
Tolgar
  • 3
1 Solution
 
for_yanCommented:
In Eclipse project you right click poroject in project browse and
selec I guess it is called Run Configuration - select default and
then there i a box Program Varibales - you shoul put in this box all parameters which normaly
come to you from PHP.

You of couse should not rely on Jaer - when debuing in Eclipse - you should have a source Java code corresposining to your classes and importa java codes into Eclipse project
0
 
TolgarAuthor Commented:
Ok I think I have main prolem.

I already have a my java code as a jar file.

Can you please explain me how I will create a project in Eclipse first from this jar file. This code uses other jar files. So what I normally do is:

I create jar file using Maven and put the jars and the .jar file in one directory. Then it works.

Now, how can I put all these (.jar libraries and .jar source code) in Eclipse and debug?

Thanks,
0
 
for_yanCommented:
You expand your jar (you can rename .jar to .zip and it will open it with WinZip).
Then from your own part (for which you have source code) - you use only source code - you don't need class files for these classes
For third party classes - you need yourr jar files

Then you create your project - it will create folder and create src folder inside
You put your java sorece files in the folder structure as they should be in that src
folder and then you right-click your project and select Build Path and again Configure Build path form submenu
and then on the popup winodw press button add external jars and then you navigate to your third party jars and
add them


0
 
for_yanCommented:
And then as I metioned before right-click oprojects and sleecet Run As and then select Run Configurations and then in thepopup window
you select tab Arguments and in the pRogram Arguments window you type your arguiuments wjhich you'll normally get from from
PHP
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now