You are not logged in.

Dear visitor, welcome to Jabaco - Community. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

abcuser

Unregistered

1

Monday, January 12th 2009, 7:36pm

How to pass parameters to Console Application from command shell?

Hi,
I would like to write application in Console Application that gets parameters from command shell and use that parameters in application.

For example, very simple sample would be:
1. start application with 1 parameter (something like java -jar "myjar myparameter")
2. print myparameter value to screen
Regards

Jubaca

Beginner

Posts: 6

Date of registration: Dec 6th 2008

  • Send private message

2

Monday, January 12th 2009, 9:57pm

Hi,

Jabaco Source

1
2
3
4
5
6
7
8
9
Public Sub main(ByJava args() As String) 
   Dim myArgs() As String 
   myArgs = args 
 
   For i = 0 To UBound(myArgs) 
  	out.println myArgs(i) 
   Next 
	
End Sub


maybe try to execute java -jar myjar myparameter without "

Rate this thread
WoltLab Burning Board