How to trace an application which is not in the current directory?

Hi,
When I use simple example 'Trace' to trace my application in current directory, it works well.
But I cannot trace the applications which are in different directory or in an .jar file. Even I've already add it to the classpath.
The following is my test:
I put Myapp.class in .\classes
java -cp .;.\classes com.sun.tools.example.trace.Trace Myappit shows me:
java.lang.NoClassDefFoundError: Myapp
Warning: classic VM not supported; client VM will be used
Exception in thread "main" -- VM Started --
-- The application exited --Can anyone help me ?
thanks

The following is my test:
I put Myapp.class in .\classes
java -cp .;.\classescom.sun.tools.example.trace.Trace MyappThere are two JVMs involved when you are tracing or debugging.
Rather than putting the classpath on your command line, set it as
an environment variable so that both JVMs can use it. That way, the
second JVM (which is executing the Myapp class) will be able to find it.
If your current directory is %JAVA_HOME%/demp/jpda, then this example
will trace the SwingSet2 demo program:
set CLASSPATH=".;%JAVA_HOME%/lib/tools.jar;%JAVA_HOME%/demo/jfc/SwingSet2/SwingSet2.jar"
java com.sun.tools.example.trace.Trace SwingSet2Let me deconstruct the CLASSPATH:
. is on the classpath so the first JVM will locate
the com.sun.tools.example.trace.Trace class relative to
your current directory. You may also use the absolute
path instead of dot.
%JAVA_HOME%/lib/tools.jar is there so both JVMs
can locate the JDI (Java Debug Interface) classes in tools.jar.
%JAVA_HOME%/demo/jfc/SwingSet2/SwingSet2.jar is
there so the second JVM (the debugee) can load the
SwingSet2 class..

Similar Messages

  • Am using short keyboard.  Don't know how to create plus sign which is not on the keyboard. Advice would be much appreciated.

    Am using short keyboard.  Don't know how to create plus sign which is not on the keyboard. There is no number pad. Advice would be much appreciated.

    nicholasmitaka-shi wrote:
    This is a Japanese kana input keyboard, A1242, whioch looks quite as usual except that a few functions have no space on the board and have been ommitted. 
    Is the plus sign really not available on your keyboard at the place indicated on this graphic (to the right of the L key)? You might need to use shift or alt/option or shift+alt/option.
    http://en.wikipedia.org/wiki/File:KB_Japanese.svg

  • Acrobat Pro "save as" function in the file menu does not show the current directory of the file

    I have installed CC but Acrobat Pro gives me headaches.
    The "save as" function in the file menu does not show the current directory of the file but something I have worked on in the past.
    It forces me to navigates through my hard disk for this very straightforward thing in normal conditions. I precise: Acrobat is the only software reacting like that.
    I use Windows7 professional 64bits.

    I use what seems to be the latest version available on the Cloud:
    To illustrate my point, I open a directory with explorer and double-click on the only PDF in there:
    So here it is, open:
    When I do a "Save as", it takes me to a totally different place on the disk!
    Very annoying...
    Thanks for your time!
    JJ

  • How do I reload _all_ tabs? Not just the current tab.

    While reading a blog, I'll open all the interesting conversations. If I'm away from the computer for a few hours, I want to refresh all the tabs with one click - not page by page by page. Thanks.

    This can be done by right-clicking on a tab and selecting "Reload All Tabs"

  • How to now the Current Directory

    Hi everyone, i have a little problem, i dont'n know how to get the name of the current directory where i have the .jar file of my applet, and i need to know which is this directory to do something on it.
    How could i know the current directory?...
    Thanks.

    Hi.
    You can not get the current directory: applets can not access the hard drive. Instead you can get the code location, which will given the current directory if running locally.
    Try this: within the applet do : getCodeBase(). This will give you an URL to the code of the Applet, that is the JAR file.
    Hope this helps,
    Nuno

  • SCCM Program - VBScripting not resolving to current Directory

    Hey Guys,
    My program is pointing to a vbScript ---> cscript.exe Sample.vbs
    This sample.vbs contains:
    Set WshShell = CreateObject("WScript.Shell")
    Set objShell = CreateObject("Shell.Application")
    Set fso = CreateObject("Scripting.FileSystemObject")
    strCurDir    = WshShell.CurrentDirectory
    strExecute = chr(34) & strCurDir & "\setup.exe" & chr(34) & " " & "/configure" & " " & chr(34) & strCurDir & "\INSTALL32UK.xml" & chr(34)
    WshShell.Run strExecute, 0, true
    The script is not picking the current directory --> Instead it is resolving to
    "C:\windows\System32\setup.exe" /cofigure "C:\windows\system32\INSTALL32UK.xml"
    The program is ever running with status in SCCM Console.
    When i check one of the client logs: I could find the below error,
    the specified object could not be found in wmi
    Please suggest any other way that my vbscript will resolve Current Directory of my DP and run successfully,

    As Torsten said Start /Wait should do the job.
    http://technet.microsoft.com/en-us/library/bb491005.aspx
    Do a /? on the .exe also to see if there are any additonal switches available. Some installers spawn other processes and have switches to keep the command prompt open (Autocad springs to mind)
    Might be worth copying your installer folder in it's entirety to the desktop of a client and run it, see what happens. Will save you a lot of time. Once you have the installer
    working fine via a local install from command prompt it will work the same when deployed through Configmgr. 

  • How to delete images from folder which are not in the database

    I am created windows form
    i wont to delete images from the folder where i have stored images but i only want to delete those images which are not in the data base.
    i don't know how it is possible . i have written some code
    private void button1_Click(object sender, EventArgs e)
    string connectionString = "Data Source";
    conn = new SqlConnection(connectionString);
    DataTable dt = new DataTable();
    cmd.Connection = conn;
    cmd.CommandText = "select * from tbl_pro";
    conn.Open();
    SqlDataAdapter da = new SqlDataAdapter(cmd);
    da.Fill(dt);
    int count = Convert.ToInt32( dt.Rows.Count);
    string[] image1 = new string[count];
    for (int i = 0; i < count; i++)
    image1[i] = dt.Rows[i]["Image1"].ToString();
    string[] image2 = new string[count];
    for (int i = 0; i < count; i++)
    image2[i] = dt.Rows[i]["Image2"].ToString();
    var arr = image1.Union(image2).ToArray();
    string[] arrays;
    String dirPath = "G:\\Proj\\";
    arrays = Directory.GetFiles(dirPath, "*", SearchOption.AllDirectories).Select(x => Path.GetFileName(x)).ToArray();
    int b= arrays.Count();
    for (int j = 1; j <= b; j++)
    if (arrays[j].ToString() != arr[j].ToString())
    var del = arrays[j].ToString();
    else
    foreach (var value in del) // ERROR DEL IS NOT IN THE CURRENT CONTEXT
    string filePath = "G:\\Projects\\Images\\"+value;
    File.Delete(filePath);
    here error coming "DEL IS NOT IN THE CURRENT CONTEXT"
    I have to change anything .Will It work alright?
    pls help me
    Sms

    Hi Fresherss,
    Your del is Local Variable, it can't be accessed out of the if statement. you need to declare it as global variable like below. And if you want to collect the string, you could use the List to collect, not a string.  the string will be split to chars
    one by one.
    List<string> del=new List<string>();
    for (int j = 1; j <= b; j++)
    if (arrays[j].ToString() != arr[j].ToString())
    del.Add(arrays[j].ToString());
    else
    foreach (var value in del)
    string filePath = "G:\\Projects\\Images\\" + value;
    File.Delete(filePath);
    If you have any other concern regarding this issue, please feel free to let me know.
    Best regards,
    Youjun Tang
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How can i send videoes which are not in camera roll via whatss app to others ?

    hi,
    I am going to know that how can i transfer video which are not in camera roll via whatss app to others ?
    thnaks in advanced.

    Where are the videos?
    If WhatsApp supports sending videos from the Camera Roll only and that is your only option, that is it.
    Contact WhatsApp. They have a website.

  • HT204053 i just brought new i phone 5 yesterday and now i can see all paid applications and i dont use or have credit card also now how i can buy applications which are important for me? can i buy them online? or use debit card

    i just brought new i phone 5 yesterday and now i can see all paid applications and i dont use or have credit card also now how i can buy applications which are important for me? can i buy them online? or use debit card and trust me all my friends are regretting buying phone because of this problem.Kindly help.Cant it can be deducted from our mobile charges?i would be much easier then

    You can buy apps using iTunes Gift cards without needing to register your debit card.
    http://store.apple.com/us/personalize/itunes

  • How do I insert a font in Mail which is not in the Pref. scroll-down menu?

    How do I insert a font in Mail which is not in the Pref. scroll-down menu?
    I love Palatino, I have it bot in the System fonts folder, in the home/library/fonts folder and in the computer/library/fonts folder.
    Yet, It does not come out.
    Something else I should be doing?

    Keep in mind that if the recipient of the email doesn't have Palantino active on their computer, they're not going to see that font on their end. Their system will replace any instance of Palantino with whatever font is they have set as the default in their mail program.

  • Help!!! the app Iphoto is closed marking a erros. I go back and open the application and are not photos. How can I recover them? Are not in the image folder.

    I was editing my photos and adding them to a album and suddenly the app is closed marking a erros. I go back and open the application and are not photos. How can I recover them? Are not in the image folder.

    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Repair Database. If that doesn't help, then try again, this time using Rebuild Database.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. (In early versions of Library Manager it's the File -> Rebuild command. In later versions it's under the Library menu.)
    This will create an entirely new library. It will then copy (or try to) your photos and all the associated metadata and versions to this new Library, and arrange it as close as it can to what you had in the damaged Library. It does this based on information it finds in the iPhoto sharing mechanism - but that means that things not shared won't be there, so no slideshows, books or calendars, for instance - but it should get all your events, albums and keywords, faces and places back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one.  
    Regards
    TD

  • HT4623 I recently upgraded my i-phone 4s phone with the new iOS7. Since that all the applications that I have opened will not close. How do I close applications that are running in the background?

    I recently upgraded my i-phone 4s phone with the new iOS7. Since that all the applications that I have opened will not close. How do I close applications that are running in the background?

    Double click your Menu button and swipe up the open Apps to close them.......

  • After restoring my iMac to factory settings it doesn't allow me to get iPhoto, iMovies and pages, which i had from the os x update. anyone knows how to recover them, as they are not on the purchased items? thanks

    after restoring my iMac to factory settings it doesn't allow me to get iPhoto, iMovies and pages, which i had from the os x update. anyone knows how to recover them, as they are not on the purchased items? thanks

    From your backup. 

  • I downloaded the Creative Cloud. I went to the section of the application and did not find the program Adobe Premiere. Tell me how and where I download a trial version of this program?

    I downloaded the Creative Cloud. I went to the section of the application and did not find the program Adobe Premiere. Tell me how and where I download a trial version of this program?

    Hi Dmirtiyter, I suspect that you have a windows computer and seems you have a 32 bit system and that's the only reason you are not getting a download option for Premiere Pro as its a 64 bit Program.

  • How to put the widget on the desktop which is not on the top mode?

    Can I drag the widget to desktop, by the method following, the widget will be on the top.
    defaults write com.apple.dashboard devmode YES
    How could I put them on desktop which is not on the top?
    Thanks a lot.

    Thanks for your advice, I am just wondering whether this program can help.
    http://www.amnestywidgets.com/WidgetBrowser.html
    One of its features is :
    Window level (desktop / standard / floating)
    Thanks a lot.

Maybe you are looking for

  • How to access tones in itunes

    how to access tones in itunes

  • Remove space in record

    HI all While executing DTP i am getting an error.INVALID CHARACTER.Its because of the space at the end of below mentioned records and also a space between * and (. '7.4*(9.92.53) '7.8*(204.25.1) I can go and correct in PSA.But for every load i need t

  • Error in XI Sender JDBC adapter for AS/400 DB2

    We are trying to connect to AS/400 DB2 from XI's Sender JDBC Adapter. we got the driver from DataDirect (connectjdbc.jar) and configured it within XI .The configuration according to the manual for this jar file is // Register the driver with the driv

  • Function keys are not working?

    hi all i am using dv-10G(10-1...) can anyone guide me how we can use our desire keys in forms. example For commit form my function keys should be look like this. commit form-----F10 Execute Query...........F11 etc plz help me sarah

  • HT201210 error 3194 when trying to update to ios6

    i haqve an iphone 4s on 5.1.1,trying to update to ios6 error 3194????