Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7578465
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T17:26:20+00:00 2026-05-30T17:26:20+00:00

I’ve tried searching for the answer but none are working for me. I’m trying

  • 0

I’ve tried searching for the answer but none are working for me.

I’m trying to run pdflatex in terminal from my java application on my Mac.

In Terminal if i type:

open -a FireFox http://www.yahoo.co.uk

it opens yahoo.co.uk in my FireFox browser

or

pdflatex x.tex

it processes the file

In my Java code I type:

open -a FireFox http://www.yahoo.co.uk'

it opens yahoo.co.uk in my FireFox browser

or

pdflatex x.tex

I get an error.

Here’s the Code:

public static void main(String args[]) {

    String s = null;

    try {

        Process p = Runtime.getRuntime().exec("pdflatex x.tex");

         BufferedReader stdInput = new BufferedReader(new
         InputStreamReader(p.getInputStream()));

         BufferedReader stdError = new BufferedReader(new
         InputStreamReader(p.getErrorStream()));

         // read the output from the command
         System.out.println("Here is the standard output of the command:\n");
         while ((s = stdInput.readLine()) != null) {
         System.out.println(s);
         }

         // read any errors from the attempted command
         System.out.println("Here is the standard error of the command (if any):\n");
         while ((s = stdError.readLine()) != null) {
         System.out.println(s);
         }

         System.exit(0);
    } catch (Exception e) {
        System.out.println("exception happened - here's what I know: ");
        e.printStackTrace();
        System.exit(-1);
    }
}

Here’s the error:

exception happened – here’s what I know:
java.io.IOException: Cannot run program “pdflatex”: error=2, No such file or directory at
java.lang.ProcessBuilder.start(ProcessBuilder.java:460) at
java.lang.Runtime.exec(Runtime.java:593) at
java.lang.Runtime.exec(Runtime.java:431) at
java.lang.Runtime.exec(Runtime.java:328) at
test.JavaRunCommand.main(JavaRunCommand.java:28)
Caused by: java.io.IOException: error=2, No such file or directory at
java.lang.UNIXProcess.forkAndExec(Native Method) at
java.lang.UNIXProcess.(UNIXProcess.java:53) at
java.lang.ProcessImpl.start(ProcessImpl.java:91) at
java.lang.ProcessBuilder.start(ProcessBuilder.java:453) … 4 more

I have tried JProc as it was a solution from another post, but it still has a similar error:

Exception in thread “main” org.buildobjects.process.StartupException:
Could not startup process ‘pdflatex x.tex ‘.
at org.buildobjects.process.Proc.(Proc.java:46) at
org.buildobjects.process.ProcBuilder.run(ProcBuilder.java:111) at
test.JavaRunCommand.main(JavaRunCommand.java:20)
Caused by: java.io.IOException:
Cannot run program “pdflatex x.tex”: error=2, No such file or directory at
java.lang.ProcessBuilder.start(ProcessBuilder.java:460) at
java.lang.Runtime.exec(Runtime.java:593) at
org.buildobjects.process.Proc.(Proc.java:43) … 2 more
Caused by: java.io.IOException: error=2, No such file or directory at
java.lang.UNIXProcess.forkAndExec(Native Method) at
java.lang.UNIXProcess.(UNIXProcess.java:53) at
java.lang.ProcessImpl.start(ProcessImpl.java:91) at
java.lang.ProcessBuilder.start(ProcessBuilder.java:453) … 4 more

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T17:26:21+00:00Added an answer on May 30, 2026 at 5:26 pm

    thanks to @alf :

    printing which pdflatex and using the resulting full path works perfectly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have just tried to save a simple *.rtf file with some websites and
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a French site that I want to parse, but am running into
I am trying to render a haml file in a javascript response like so:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.