Java command line interfaces seem to have limits?
HelloThe code I use normally use stuff 'old-school' process (Runtime.getRuntime () .exec ("...")) when I noticed this problem, but I have since moved to the 'new school' ProcessBuilder class (ProcessBuilder.start ()).
Basically, what I do is to dynamically generate an order of command line based on some user input. It is be a netezza command ("nzload"), but I don't think it's really too important.
The command that has been generated is:
nzload-host 'ipaddress' u 'username' - pw "password" - db "databasename" t "tablename" securityLevel - preferredSecured - df "/ pretty/long/path/to/data/file.csv"-logFileSize 2000 - delim, - quotedValue No.
(P.S. I got this NZLOAD command by adding an 'echo' in front of 'nzload' in my processbuilder. Output, then the published standard my order that I could copy and paste in a test outside Java shell.)
If I copy/paste this line in the shell on the computer, on that copy the following code executes, it works perfectly. However (and don't forget, this line has been generated by my code), it runs using ProcessBuilder.Start () gives me weird errors. From the beginning, it seemed that errors had something to do with the quotes. I tried single quotes, double quotes, and finally I took the quotes on. So far my experience with this is that if I have even a set of quotes in there, the NZLOAD utility return strange errors like "can't connect" or something on the level of security is not wrong. It seems that maybe the quotes are somehow If incompatible in Java so it tries to take 'more' than I want only it for, say, the "hostname" parameter However, these errors are B.S. since I can run the same exact command in the command line with success (no copy and paste nonsense).
For reference, my code processbuilder is something like this:
ProcessBuilder pb = new ProcessBuilder();
PB.Command (). Add ("nzload");
String hn = this. Host;
* if (hn! = null & & hn.trim () .length () > 0) {*}
PB.Command (). Add("-Host");
PB.Command (). Add (HN);
*}*
* if (user.trim () .length () > 0) {*}
PB.Command (). Add ("u");
PB.Command (). Add (User.Trim ());
PB.Command (). Add("-PW");
PB.Command (). Add (Pass.Trim ());
*}*
*//...*
Process p = pb.start ();
RV = p.waitFor ();
* //grab deviation / entry and displays TI *.
(Obviously it's an extract without any quote either. A_le_prealable, I got the quotes around all of these areas, such as pb.command () .add ("------" "+ hn +" \ "");.)
(1) how can I debug this problem so that it is more generic and easy to understand (rather than use orders nzload that none of you guys probably know anything)?
(2) are there any limitations/known issues with using Java shell command execution?
Thank you guys!
Where "certain limits" == "huge PITA? Can't disagree with that.
I would not spend more time trying to debug that. I would just pass to the ProcessBuilder constructor that takes a list or an array of strings and let him deal with the problems of scoring. Or at least start with that and see if there are still citing questions yet.
Tags: Java
Similar Questions
-
I can't seem to make the tour of the following pop up: "to use the"java"command line tool, you must install JDK. I downloaded Java for many times, but the pop-up Guard reappear. Is there any solution to get rid of this pop up, it makes me crazy? Help, please!
What java you have download and install. To install is TIME legacy java 6 Apple for OS X, which can be downloaded here: Download Java for OS X 2015-001
-
How do I access the command line interface so I can set up my series of cisco router 2600. I don't seem to know where that on my netbook. What port also can connect the cable to the internet router.
Hello
You must Access the port console of the router using a cable from the console. Your netbook probably doesn't have a serial port to do this, so you will need a USB-serial adapter.
Once you have, you need terminal software. PuTTy is a good lightweight program that you can download for free.
If you want to give the internet router, you must choose a WAN port. Assuming that you don't have a HWIC-ESW in the router, any port will do.
There is here a guide that can be useful for:
http://www.internetworkingcareer.com/command-line/how-to-access-the-Cisco-CLI-from-the-console/
I hope this helps.
Kind regards
Tim
-
I get a message: to use the 'java' command line tool, you must install a JDK. I tried 10 times to install without success. Help, please.
You probably have some of the older than the needs/desires software legacy Java installed.
Please see these sons of community message:
Just found this last Java does not work with El Capitan
This is the Apple link to the legacy version of Java 6.
Download Java for OS X 2015-001
First of all, I would like to try to identify what application generated the next message and update (delete) this request as the case may be. If you need to run Java then, as the Apple Support page says it's certainly preferable that your installation of Java entirely up-to-date with the Oracle's Java course. If you can get without Java, you should install it not - like the Flash, it should not be installed unless you have no choice.
-
vSphere command-line Interface (vCLI)
Hello
first of all, sorry for my English...
I'm new here and I have a question for VMWARE vSphere Hypervisor.
I have donwloaded VMware vSphere Hypervisor (ESXi) and installed the server component and the Client.
Now, I want to use my client "vSphere command-line Interface (vCLI)", but I can't find it on my client.
Can someone help me?
Greetings
Markus
Hello
I think you should download the bundle separately. Please download the version of your esxi version.
VMware vSphere 5: Private Cloud Computing, server and data center virtualization
Post edited by: Dee006
-
Good afternoon
Please can you help to create custom reports in "Essential Openmanage" using "Essentials" command line Interface
The default reports are not feasible.
Hi there Oswaldo and thank you for the question.
Currently, OME 1.3 doesn't have a custom report generator. I don't think that the CLI help as it is mainly used to set up from the beaches of discovery and things like that.
There is a REST API that _may_ allow to return by the data of the database of the MEO program. The REST API guide is in the section of the Documentation on the Dell TechCenter for OME page.
Thank you
Rob
-
How to create a 'command-line interface' for a game?
Hey people,
For a game that I have to make a similar command-line interface where the user has at least 3 options to respond with, anyone know how to on this subject?
I hope someone here can help me out!
Kind regards
Angela
I don't know what part of it, you are having trouble with. Imagine for a moment that instead of asking for your end user typing something into a text input field and monitor what they type (maybe), who instead of you provide 3 buttons on your stage. Answering a press of button in this scenario as respondent to typed user input - your film something is based on the interaction of the user. Enter the user entered text scenario, a text or field sprite can detect the key ENTER and examine the string that the user entered, something like:
on keyDown me if _key.keyCode = 36 then stopEvent sText = sprite(me.spriteNum).member.text case sText of "hack": -- do whatever you need to here "research": "wait": otherwise: end case else pass end if end
-
Hello, how is it possible to create the FAT32 BOOTCAMP on CoreStorage partition via the command line interface?
I mean ' diskutil cs * " and so on..."
Yes, you must use the resizeStack command. Please see Re: how to repair fsck "your drive could not be partitioned..." Bootcamp does not as an example.
-
Control CMD (command line interface) using Labview 2011.
Hello
I'm trying to control software that has an interface to command line using LabView 2011 but I have problems when reading the information.
Is attached the VI I created so far, but it is not working properly.
Problems so far:
1 - if I use ReadLine(), it blocks showing no error and nothing else.
2 - ReadToEnd () same problem as the previous line, the software hangs just at this stage.
3 - if I compare the response of the "peek" in waiting for the - 1 indicating there is not more character, the hook of software as the previous steps.
You have some clues as to what might be wrong or another way to 'control' the CMD to send messages, read and send messages, etc...
Thank you very much for your help.
I've done it before - I posted about this on the forum here: https://forums.ni.com/t5/LabVIEW/How-to-open-close-and-monitor-a-application-xyz-exe-using/m-p/32511...
I did also wrap in a library at a given time and post it on the forums, but I couldn't find this particular post.
-
How to update the data of the CLI command line interface store
Dear friends
I use VMWare Server 2.0 on a debian linux server.
I need to be able to update the store data from the command line, this because I put the command Refresh within a bash script.
Of course, I know how the web management, but as you understand, I need to do from the console.
Thanks for the answer, help or advice
Robert
Post edited by: FAsTec
Hello
Try vmware-vim-cmd.
As in:
vmware-vim-cmd /hostsvc/datastore/refresh
You may need to add the store of data as a parameter.
See also:
http://www.VI-Toolkit.com/wiki/index.php/hostsvc/datastore/refresh
Beware that your username must have good credentials to run the command.
Hope this helps
--
Wil
_____________________________________________________
VI Toolkit & scripts wiki at http://www.vi-toolkit.comWriter to the blog www.planetvm.net
Twitter: @wilva
-
Where can I find more details about command line interface?
Specifically, I wonder how we remove something that has been installed, like homebrew, xcode, etc.. But, just generalities would be useful.
-
Need to install Java command line tool
I get this error after the installation of the new OS sierra. Java is up to date. How can I fix it? Thank you.
The most likely cause is the program that wants to use Java's only request the use of Apple legacy Java 6. That the developers didn't like enough to have use Java the right way, you need to install Apple legacy Java 6 or uninstall the program that wants to use Java - likely produced Adobe or a Facebook video chat program.
Download Java for OS X 2015-001
Maybe it's that the program requires a JDK be installed instead the JRE from Java.com. So, if you download the SDK Java Oracle of Oracle's Web site, then you might try that if you have a recent version of Java. However, I don't think I've seen someone declare that as successful as the program who need Java so poorly designed.
-
vSphere command-line Interface
I was looking at the order for the vCLI reference and have two questions:
There are orders for the export of ovfs? I looked good enough and could not find. orders for the export of .vmdks could there be to make offline backups?
I noticed there was an option for vmotion using the vCLI... which requires a license full vsphere, or is - this can be used on just the free version of ESXi with the vCLI?
Thank you.
The ovftool does not come with vCLI, but is available for windows, mac & linux VMware:
http://communities.VMware.com/community/VMTN/vSphere/automationtools/OVF
For export VMDK, you can modify the file browser scripts to catch them from the data store, or watch William Lam ghettoVCB scripts.
For vMotion, the script works only with a vCenter vMotion-enabled - no way to get there with raw ESXi.
-
No small business SF200 smart switches command line interface?
Hi all, we just got 5 new smart switches SF200-48 for small businesses. I noticed that the only way I can set them up is to use the web gui. Is there a way to allow the good old CLI?
Hi Ricky, without that this device has no CLI support.
-Tom
Please evaluate the useful messages -
Download vSphere command-line Interface
I tried to download the vSphere CLI come and got the following error message
Internal error
The VMware download portal encountered an error when processing your request. We are sorry for the inconvenience. If you choose to report this error, please provide the following error information:
Error code: QJ56
The error date: Thu Nov 15 07:07:14 PST 2010
4 reviews for Err:...
Exception: The JDBC exception on Hibernate data access; nested exception is org.hibernate.exception.GenericJDBCException: could not execute the query
Has anyone encountered this before? And there at - it another way I can get my hands on the CLI. I already downloaded the ESXi 4-0-4-1 update. ISO but can't find the CLI top anywhere. We are to halfway through the upgrade of two hosts ESXi and vSphere & vCentre upgrades did
Thank you
See screenshot
http://downloads.VMware.com/d/details/vcli41/ZHcqYmRoaCpiZCVodw==
Maybe you are looking for
-
Passage of restoring iCloud to iTunes
Hi, I just got a replacement iPhone. Before it was replaced I have full backups of my iMac (via iTunes) and icloud. I was away from home when I got then started replacing the restoration to iCloud by using WiFi. The problem is that my photos (about 1
-
I just downloaded iTunes on my new PC Win 10. First of all, I inserted the backup from the old PC files (iTunes/music libraries, etc.). At the opening of the iTunes I can't find the 40 GB of old files. I have tried edition/preferences/Advanced tab,
-
Since the updates screen pulses.
11-12, I installed automatic dates, my computor started the cursor and the border around the program of pulses every 3-7 seconds, this causes the cowardly im what ever do. I tried to perform a restore, but failed. I did a restore in safe mode, but th
-
Impossible to verify the Windows updates (error Code 0 x 80070424)
original title: Error Code 0 x 80070424 I'm unable to access the Windows Update site and Erro Code 0 x 80070424 is visible. I use Windows XP Home Edition 5.1.2600 Service Pack 3 and Internet Explorer 8. I discovered this when I inserted a CD in my S
-
E4200 V1 1.05 firmware https vs http...
I decided to try to activate http and https. With https if. Using the latest version of Firefox, btw. Why is it so extremely slow in the firmware with gui? Once I disable https and return to the default setting of the http protocol. Gui firmware move