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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:10:48+00:00 2026-05-13T15:10:48+00:00

At the moment I have to go to /usr/java/apache-solr-1.4.0/example and then do: java -jar

  • 0

At the moment I have to go to /usr/java/apache-solr-1.4.0/example and then do:

java -jar start.jar

How do I get this to start automatically on boot?

I’m on a shared Linux server.

  • 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-13T15:10:48+00:00Added an answer on May 13, 2026 at 3:10 pm

    If you have root access to your machine, there are a number of ways to do this based on your system’s initialization flow (init scripts, systemd, etc.)

    But if you don’t have root, cron has a clean and consistent way to execute programs upon reboot.

    First, find out where java is located on your machine. The command below will tell you where it is:

    $ which java
    

    Then, stick the following code into a shell script, replacing the java path below (/usr/bin) with the path you got from the above command.

    #!/bin/bash
    
    cd /usr/java/apache-solr-1.4.0/example
    /usr/bin/java -jar start.jar
    

    You can save this script in some location (e.g., $HOME) as start.sh. Give it world execute permission (to simplify) by running the following command:

    $ chmod og+x start.sh
    

    Now, test the script and ensure that it works correctly from the command line.

    $ ./start.sh
    

    If all works well, you need to add it to one of your machine’s startup scripts. The simplest way to do this is to add the following line to the end of /etc/rc.local.

    # ... snip contents of rc.local ...
    # Start Solr upon boot.
    /home/somedir/start.sh
    

    Alternatively, if you don’t have permission to edit rc.local, then you can add it to your user crontab as so. First type the following on the commandline:

    $ crontab -e
    

    This will bring up an editor. Add the following line to it:

    @reboot /home/somedir/start.sh
    

    If your Linux system supports it (which it usually does), this will ensure that your script is run upon startup.

    If I don’t have any typos above, it should work out well for you. Let me know how it goes.

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

Sidebar

Ask A Question

Stats

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

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

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

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

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The other answers are correct. Here is some code you… May 14, 2026 at 9:40 am
  • Editorial Team
    Editorial Team added an answer you ruin the noConflict concept by reassigning the jquery to… May 14, 2026 at 9:40 am
  • Editorial Team
    Editorial Team added an answer If you get that particular error, you don't actually have… May 14, 2026 at 9:40 am

Related Questions

No related questions found

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.