LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-13-2021, 01:17 PM   #1
xg3571
LQ Newbie
 
Registered: Dec 2021
Posts: 12

Rep: Reputation: Disabled
How to fix java.io.IOException: Cannot run program "getContentHtml" (in directory "."): error=2, no such file exception??


I stored python script getContentHtml and InspectSite.java file in current directory

InspectSite.java code:
Code:
Process process = Runtime.getRuntime().exec("getContentHtml "+url, null, new File("./"))
...
and console print error message Cannot run program "getContentHtml" (in directory ".")
absolute path doesn't work too.
 
Old 12-13-2021, 03:53 PM   #2
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,249

Rep: Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323Reputation: 5323
Is getContentHtml executable?

Last edited by dugan; 12-13-2021 at 04:11 PM.
 
2 members found this post helpful.
Old 12-13-2021, 04:31 PM   #3
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 3,623

Rep: Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555

As Dugan suggests, it'll probably be a permissions issue, but why do you want to call Python from Java?

Based on the function name, you may be able to just use JSoup instead.

 
1 members found this post helpful.
Old 12-14-2021, 02:32 AM   #4
xg3571
LQ Newbie
 
Registered: Dec 2021
Posts: 12

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by boughtonp View Post
As Dugan suggests, it'll probably be a permissions issue, but why do you want to call Python from Java?

Based on the function name, you may be able to just use JSoup instead.

just for practice
I'm planning to make a java program calling python deeplearning module
 
Old 12-14-2021, 02:35 AM   #5
xg3571
LQ Newbie
 
Registered: Dec 2021
Posts: 12

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by dugan View Post
Is getContentHtml executable?
After reading your comment I realized that parameter "getContentHtml" should be "./getContentHtml"
I'm a PEBCAK

Last edited by xg3571; 12-14-2021 at 02:54 AM. Reason: PEBCAK
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to fix error: " error while loading shared libraries: libssl.so.1.0.0: cannot open shared object file: No such file or directory"? justa_skid Linux - Newbie 2 02-22-2021 02:23 AM
org.omg.CORBA.COMM_FAILURE: IOException: java.net.SocketException: Broken pipe (errno julu.99 Linux - Networking 0 12-21-2011 01:23 AM
Runtime.getRuntime().exec("cd") returns java.io.IOException, error 2 in java tatarin Programming 4 03-28-2008 07:42 PM
Java IOException: Too many open files naijaguy Programming 0 02-01-2005 05:20 PM
Java "throws IOException" problem Nylex Programming 5 01-30-2004 08:49 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:00 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration