Java io ioexception cannot run program linux

java.io.IOException: error=2, No such file or directory #1

Comments

grvhi commented Oct 22, 2014

@knorwood — Firstly, thanks for getting this out! Really great stuff.

I’ve hit a small issue in that java can’t find my program:

java.io.IOException: Cannot run program «consumers.py»: error=2, No such file or directory

I’ve set the executableName = consumers.py in my properties file. Is that path relative to dir in which I’m running the command? Or is absolute? (I’ve tried both, with no luck).

Also, I can’t seem to find much on the recommended way to daemonize the process?

The text was updated successfully, but these errors were encountered:

grvhi commented Oct 22, 2014

If anyone comes along later, the path is (or can be) absolute. And to daemonize, look no further than supervisord

knorwood commented Oct 22, 2014

Thanks for the feedback and glad to hear you’ve gotten things working.

I’ll clarify some more for others. The MultiLangDaemon uses the environment that the jvm was launched in. On linux/unix systems the relevant environment variable that it uses to find the executable is PATH. You can test that your executable will be found using which (filling in the executable’s name). I usually install my python packages within a virtualenv so I don’t have to manually fiddle with the PATH variable.

grvhi commented Oct 22, 2014

Thanks @knorwood — I had a few issues getting the virtualenv working as expected; I’m passing longer-running consumer tasks off to celery and it was a bit fiddly to get the celery app/imports working correctly.

Can I suggest a little more in the docs to demonstrate the optimal virtualenv-based setup? Perhaps out of scope though.

Читайте также:  Как написать простое приложение для windows

But again, thanks for getting this out — I was running a «consumer» with celery tasks until now, which worked, but very happy to using the official KCL without having to dive into java.

Tenzer commented Oct 30, 2014

For other people who might come across this issue due to the same «No such file or directory» error message from Java, the solution is simply to make the Python script executable and define the path in the properties file as executableName = ./consumers.py instead of just providing the file name.

sid137 commented Oct 30, 2014

still no luck with @Tenzer ‘s solution. set executable permissions to 755 and even tried to modify the PATH for the command..

PATH=/Users/sid137/ivizone/kinesis-access-point-monitor:$PATH python amazon_kclpy_helper.py —print_command —java /usr/bin/java —properties app.properties

Tenzer commented Oct 30, 2014

@sid137 Do you have app.py in the current working directory while running that command?
Also, just to be sure — you made app.py executable and not amazon_kclpy_helper.py , right?

sid137 commented Oct 30, 2014

That’s correct. I run tht command from the same directory as app.py and
app.properties

App.py is what has the file permissions set to 755

I can create a sample repo when I get home if that’s helpful

Although I basically took the sample app code and modified it locally to
just get something up and running on my stream

On Thursday, October 30, 2014, Jeppe Toustrup notifications@github.com
wrote:

@sid137 https://github.com/sid137 Do you have app.py in the current
working directory while running that command?
Also, just to be sure — you made app.py executable and not
amazon_kclpy_helper.py, right?


Reply to this email directly or view it on GitHub
#1 (comment)
.

knorwood commented Oct 30, 2014

Another approach to try is to define the executableName to be python with the full path to the script as its argument, like this.

Another approach that I’d suggest if you’re using virtualenv, is to define a setup.py and install your script before running the MultiLangDaemon. Your setup.py should minimally contain:

And setuptools should install the script appropriately.

Источник

java.io.IOException: Cannot run program ERROR #7598

Comments

fnguyen99 commented May 14, 2018

Hi,
We spent 4 hours yesterday trying to solve this problem, and couldn’t find anything on the web.
Can you please provide useful suggestion to sharper1999@gmail.com?

================
Arduino: 1.8.6 Hourly Build 2018/05/10 01:33 (Windows 10), Board: «Arduino/Genuino Uno»

Sketch uses 2492 bytes (7%) of program storage space. Maximum is 32256 bytes.
Global variables use 208 bytes (10%) of dynamic memory, leaving 1840 bytes for local variables. Maximum is 2048 bytes.
.
java.io.IOException: Cannot run program «/bin/avrdude»: CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at processing.app.helpers.ProcessUtils.exec(ProcessUtils.java:26)
at cc.arduino.packages.Uploader.executeUploadCommand(Uploader.java:129)
at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:207)
at cc.arduino.UploaderUtils.upload(UploaderUtils.java:78)
at processing.app.SketchController.upload(SketchController.java:732)
at processing.app.SketchController.exportApplet(SketchController.java:703)
at processing.app.Editor$DefaultExportHandler.run(Editor.java:2197)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.(ProcessImpl.java:386)
at java.lang.ProcessImpl.start(ProcessImpl.java:137)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
. 8 more
An error occurred while uploading the sketch

This report would have more information with
«Show verbose output during compilation»
option enabled in File -> Preferences.

The text was updated successfully, but these errors were encountered:

PaulStoffregen commented May 14, 2018

In those 4 hours, did you try downloading the 1.8.5 (stable release) ZIP file and run that version? Does 1.8.5 work, or also fail?

Читайте также:  Простой фон для windows

You might also try temporarily disabling any anti-virus software, and Windows Defender. Sometimes these cause trouble.

matthijskooijman commented May 15, 2018

Who is paying for my 4 hours of wasted time on version 1.8.5? . I thought 1.8.5 was stable?

1.8.5 is indeed the stable version, but your report says you were using «1.8.6 Hourly Build» instead, which I think is what prompted @PaulStoffregen’s suggestion to try 1.8.5.

Could it be that you have an older version of the AVR boards installed? You could try updating to the latest version through the boards manager in the IDE.

facchinm commented May 15, 2018

Found the bug, a fix is ongoing. Thanks for reporting, but always use stable builds (1.8.5 in this case) if you need something stable.

facchinm commented May 15, 2018

Fixed by bc19d7b , AVR core 1.6.22 is not yet published in the actual package_index so it was discarded due to the missing overlay. Builds are ongoing

dcetin01 commented Dec 11, 2018

I too, recently had a similar ‘error’ and have always used 1.8.5 build, please help!!
Here is a copy of the error:

Arduino: 1.8.5 (Windows 10), Board: «Arduino/Genuino Uno»

Sketch uses 4420 bytes (13%) of program storage space. Maximum is 32256 bytes.
Global variables use 483 bytes (23%) of dynamic memory, leaving 1565 bytes for local variables. Maximum is 2048 bytes.
java.io.IOException: Cannot run program «C:\Users\dcetin01\Arduino\hardware\tools\avr/bin/avrdude»: CreateProcess error=193, %1 is not a valid Win32 application
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at processing.app.helpers.ProcessUtils.exec(ProcessUtils.java:26)
at cc.arduino.packages.Uploader.executeUploadCommand(Uploader.java:129)
at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:207)
at cc.arduino.UploaderUtils.upload(UploaderUtils.java:78)
at processing.app.SketchController.upload(SketchController.java:713)
at processing.app.SketchController.exportApplet(SketchController.java:686)
at processing.app.Editor$DefaultExportHandler.run(Editor.java:2168)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.IOException: CreateProcess error=193, %1 is not a valid Win32 application
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.(ProcessImpl.java:386)
at java.lang.ProcessImpl.start(ProcessImpl.java:137)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
. 8 more
An error occurred while uploading the sketch
Invalid library found in C:\Users\dcetin01\Documents\Arduino\libraries\arduino_115740: C:\Users\dcetin01\Documents\Arduino\libraries\arduino_115740
Invalid library found in C:\Users\dcetin01\Documents\Arduino\libraries\arduino_269568: C:\Users\dcetin01\Documents\Arduino\libraries\arduino_269568
Invalid library found in C:\Users\dcetin01\Documents\Arduino\libraries\arduino_305492: C:\Users\dcetin01\Documents\Arduino\libraries\arduino_305492
Invalid library found in C:\Users\dcetin01\Documents\Arduino\libraries\arduino_545055: C:\Users\dcetin01\Documents\Arduino\libraries\arduino_545055
Invalid library found in C:\Users\dcetin01\Documents\Arduino\libraries\arduino_696625: C:\Users\dcetin01\Documents\Arduino\libraries\arduino_696625
Invalid library found in C:\Users\dcetin01\Documents\Arduino\libraries\arduino_721834: C:\Users\dcetin01\Documents\Arduino\libraries\arduino_721834
Invalid library found in C:\Users\dcetin01\Documents\Arduino\libraries\arduino_795191: C:\Users\dcetin01\Documents\Arduino\libraries\arduino_795191
Invalid library found in C:\Users\dcetin01\Documents\Arduino\libraries\arduino_920364: C:\Users\dcetin01\Documents\Arduino\libraries\arduino_920364
Invalid library found in C:\Users\dcetin01\Documents\Arduino\libraries\arduino_930976: C:\Users\dcetin01\Documents\Arduino\libraries\arduino_930976
Invalid library found in C:\Users\dcetin01\Documents\Arduino\libraries\arduino_96981: C:\Users\dcetin01\Documents\Arduino\libraries\arduino_96981
Invalid library found in C:\Users\dcetin01\Documents\Arduino\libraries\U8glib: C:\Users\dcetin01\Documents\Arduino\libraries\U8glib
Invalid library found in C:\Users\dcetin01\Documents\Arduino\libraries\arduino_115740: C:\Users\dcetin01\Documents\Arduino\libraries\arduino_115740
Invalid library found in C:\Users\dcetin01\Documents\Arduino\libraries\arduino_269568: C:\Users\dcetin01\Documents\Arduino\libraries\arduino_269568
Invalid library found in C:\Users\dcetin01\Documents\Arduino\libraries\arduino_305492: C:\Users\dcetin01\Documents\Arduino\libraries\arduino_305492
Invalid library found in C:\Users\dcetin01\Documents\Arduino\libraries\arduino_545055: C:\Users\dcetin01\Documents\Arduino\libraries\arduino_545055
Invalid library found in C:\Users\dcetin01\Documents\Arduino\libraries\arduino_696625: C:\Users\dcetin01\Documents\Arduino\libraries\arduino_696625
Invalid library found in C:\Users\dcetin01\Documents\Arduino\libraries\arduino_721834: C:\Users\dcetin01\Documents\Arduino\libraries\arduino_721834
Invalid library found in C:\Users\dcetin01\Documents\Arduino\libraries\arduino_795191: C:\Users\dcetin01\Documents\Arduino\libraries\arduino_795191
Invalid library found in C:\Users\dcetin01\Documents\Arduino\libraries\arduino_920364: C:\Users\dcetin01\Documents\Arduino\libraries\arduino_920364
Invalid library found in C:\Users\dcetin01\Documents\Arduino\libraries\arduino_930976: C:\Users\dcetin01\Documents\Arduino\libraries\arduino_930976
Invalid library found in C:\Users\dcetin01\Documents\Arduino\libraries\arduino_96981: C:\Users\dcetin01\Documents\Arduino\libraries\arduino_96981
Invalid library found in C:\Users\dcetin01\Documents\Arduino\libraries\U8glib: C:\Users\dcetin01\Documents\Arduino\libraries\U8glib

This report would have more information with
«Show verbose output during compilation»
option enabled in File -> Preferences.

facchinm commented Dec 11, 2018

@dcetin01 your bug is different as seems related with an antivirus activity. Try whitelisting «C:\Users\dcetin01\Arduino\hardware\tools\avr/bin/avrdude» (maybe you’ll have to reinstall the IDE, it depends on your antivirus) and you should be fine.

You can’t perform that action at this time.

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.

Источник

Build failed with message «Caused by: java.io.IOException: Cannot run program «javac»: CreateProcess error=2″ #394

Comments

apocarteres commented Jan 28, 2015

same build under OS X is fine

  1. Windows 7 Rus clean install
  2. Maven 3.2+
  3. Oracle JDK 7
  4. clean checkout of master
Читайте также:  Буфер обмена windows где находится

The text was updated successfully, but these errors were encountered:

apocarteres commented Jan 28, 2015

looks like user name in Russian locale is a culprit

actual username is «кондратка» but path contains something crazy «19E8

1″
that’s why process builder returns error status 2 — no such file
needs to be double checked

yegor256 commented Jan 28, 2015

@apocarteres how can I reproduce the problem?

apocarteres commented Jan 28, 2015

@yegor256 i described it in the end of first message

Windows 7 Rus clean install
Maven 3.2+
Oracle JDK 7
clean checkout of master

apocarteres commented Jan 28, 2015

ok i figured out. Username doesn’t affect build.
The problem is that ProcessBuilder can’t find javac executable.
com.qulice.findbugs.BytecodeMocker at the line 74

looks like ProcessBuilder doesn’t take into account PATH environment variable
so i hacked code a little bit such:

and it works well

yegor256 commented Jan 28, 2015

@apocarteres but Appveyor builds everything without problems. Looks like it’s your local problem, don’t you think?

apocarteres commented Jan 28, 2015

@yegor256 Appveyor uses win2k and EN locale. Probably it’s may be a corner. I have clean local win7 installation, several other projects jcabi* build well there. Not sure that’s local problem

yegor256 commented Jan 29, 2015

@apocarteres do you have any suggestion how this may be fixed? As I see, Windows gives us a wrong path.. We just can’t do anything about it, inside our plugin. But maybe I’m wrong.

apocarteres commented Jan 29, 2015

@yegor256 i think the root cause is connected with passing environments variables between components of application. it should be debugged to say what’s is happening there.

yegor256 commented Jan 29, 2015

1 can’t generated by our plugin. It’s coming from operating system.

apocarteres commented Jan 29, 2015

@yegor256 correct. but it’s not an issue. the problem is that javac can’t be found in com.qulice.findbugs.BytecodeMocker line 71

apocarteres commented Jan 29, 2015

as mentioned above

davvd commented Jan 30, 2015

@nhekfqn the task is yours plz proceed

davvd commented Jan 30, 2015

@apocarteres thanks a lot for reporting, 15 mins added to your acc, pmt ID 50954585

palyuga commented Jan 30, 2015

@yegor256 It’s duplication of #380
Happens when javac not in PATH

apocarteres commented Jan 30, 2015

@palyuga don’t think so. pls take a look at screenshots


apocarteres commented Jan 30, 2015

@palyuga furthermore the code

palyuga commented Jan 30, 2015

@apocarteres yep, I was wrong then, it’s not a duplication)

nhekfqn commented Feb 8, 2015

@davvd Please find someone else to do this task.

davvd commented Feb 9, 2015

@davvd Please find someone else to do this task.

@nhekfqn someone else will help in this task, no problem at all

krzyk commented Nov 3, 2015

@davvd this is postponed

davvd commented Nov 4, 2015

@krzyk got it, «postponed» label here

davvd commented Nov 4, 2015

@krzyk someone else will help in this task, no problem at all

Источник

Оцените статью