|
-
May 2nd, 2012, 07:45 PM
#1
Thread Starter
Junior Member
execute .jar via VB
im trying to code a simple GUI to launch a .jar with a user specified memory range. for example this is the command line im currently using in a .bat
java.exe -Xmx3g -Xms512m -jar program-name.jar
i want to call this in VB and replace the Xmx"" and Xms"" with the input from the text box
any help is greatly appreciated
im new here so chances are this is in the wrong forum section if it is i apologize
-
May 2nd, 2012, 07:53 PM
#2
Re: execute .jar via VB
Use Shell, something like this
vb Code:
Private Sub Command1_Click() Shell "java.exe " & Text1.Text & " " & Text2.Text & "jar program-name.jar", vbNormalFocus End Sub
-
May 2nd, 2012, 10:10 PM
#3
Re: execute .jar via VB
If java.exe isn't in the current PATH you might need to provide a fully-qualified path to it too. If your .jar file isn't in the Current Directory you'll want a full name here as well. Both of those mean extra quotes:
Code:
Shell """C:\Program Files\Java\jre6\bin\java.exe"" " _
& Text1.Text _
& " " _
& Text2.Text _
& " jar ""D:\My Java Stuff\program-name.jar""", _
vbNormalFocus
-
May 2nd, 2012, 11:02 PM
#4
Thread Starter
Junior Member
Re: execute .jar via VB
 Originally Posted by 4x2y
Use Shell, something like this
vb Code:
Private Sub Command1_Click()
Shell "java.exe " & Text1.Text & " " & Text2.Text & "jar program-name.jar", vbNormalFocus
End Sub
that did it (with a bit of tinkering) thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|