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 63215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T18:35:51+00:00 2026-05-10T18:35:51+00:00

Question I have an application written in Java. It is designed to run on

  • 0

Question

I have an application written in Java. It is designed to run on a Linux box standalone. I am trying to spawn a new firefox window. However, firefox never opens. It always has a shell exit code of 1. I can run this same code with gnome-terminal and it opens fine.

Background

So, here is its initialization process:

  1. Start X ‘Xorg :1 -br -terminate -dpms -quiet vt7’
  2. Start Window Manager ‘metacity –display=:1 –replace’
  3. Configure resources ‘xrdb -merge /etc/X11/Xresources’
  4. Become a daemon and disconnect from controlling terminal

Once the program is up an running, there is a button the user can click that should spawn a firefox window. Here is my code to do that. Remember X is running on display :1.

Code

 public boolean openBrowser() {   try {     Process oProc = Runtime.getRuntime().exec( '/usr/bin/firefox --display=:1' );     int bExit = oProc.waitFor();  // This is always 1 for some reason      return true;    } catch ( Exception e ) {     oLogger.log( Level.WARNING, 'Open Browser', e );     return false;   } } 
  • 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. 2026-05-10T18:35:52+00:00Added an answer on May 10, 2026 at 6:35 pm

    after having read the various answers and various comments(from questioner), here’s what I would do

    1) try this java approach http://java.sun.com/j2se/1.5.0/docs/api/java/lang/ProcessBuilder.html

    ProcessBuilder pb = new ProcessBuilder('myCommand', 'myArg1', 'myArg2'); Map<String, String> env = pb.environment(); env.put('VAR1', 'myValue'); env.remove('OTHERVAR'); env.put('VAR2', env.get('VAR1') + 'suffix'); pb.directory('myDir'); Process p = pb.start(); 

    see more about this class:

    http://java.sun.com/developer/JDCTechTips/2005/tt0727.html#2
    http://www.javabeat.net/tips/8-using-the-new-process-builder-class.html

    2) try doing this(launching firefox) from C/C++/ruby/python and see if that is succeeding.

    3) if all else fails, I would launch a shell program and that shell program would launch firefox!!

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

Sidebar

Ask A Question

Stats

  • Questions 121k
  • Answers 121k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Yes, create a class library and move any types you… May 12, 2026 at 12:24 am
  • Editorial Team
    Editorial Team added an answer I think there are 3 options: Change your ANT script… May 12, 2026 at 12:24 am
  • Editorial Team
    Editorial Team added an answer technically, a SHA1 hash is a number, it is just… May 12, 2026 at 12:24 am

Related Questions

I have an application written in Java that uses a jar file(it uses more
I have an application written in java, and I want to add a flash
I have an application written in C++ (makes heavy use of templates) that I
I have an enterprise application written in JAVA with JSF (using RichFaces 3.3). Currently

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.