CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2000
    Location
    canada
    Posts
    60

    Use a java compiled class in vb

    Hi,

    i've class writted and compiled in java that i want to use in vb. Does somebody have any idea about how to make it work.

    Thanks i advance.
    I will rate your response.

    "the opposition of the opposites is the engine of becoming"

  2. #2
    Join Date
    Apr 2001
    Location
    Wisconsin, USA
    Posts
    150

    Re: Use a java compiled class in vb

    Assuming that the java class is run when you click on a button or menu item, try the shell function. Example:



    private Sub menu_Clicked()
    Dim RetVal as Long

    RetVal = Shell("c:\yourFolder\yourClass", 1)
    End Sub




    Now, this is in theory that this should work. The Shell function documentation states that this is for running
    executable files, but if you have your classpath variable set correctly, this should work. Try this out and let me know
    if it does or not.


  3. #3
    Join Date
    Mar 2000
    Location
    canada
    Posts
    60

    Re: Use a java compiled class in vb

    Hi,

    the problem with your solution is that, the class is only compiled (.class) and to execute it by the way you are suggering, i need a JVM. Is it another solution with only VB.

    Thanks

    "the opposition of the opposites is the engine of becoming"

  4. #4
    Join Date
    Apr 2001
    Location
    Wisconsin, USA
    Posts
    150

    Re: Use a java compiled class in vb

    Assuming you are running windows 9x/2000/ME/NT, you should have a JVM preinstalled on your machine. In
    fact, how do you run the java class without the vb code? Does the java class run fine from the command line?
    If the java class can be run from the command line, then you should be able to run it with the shell command
    in VB.


Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured