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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T22:51:00+00:00 2026-06-09T22:51:00+00:00

I am trying to run a simple JAVA program once per day on a

  • 0

I am trying to run a simple JAVA program once per day on a Windows 7 machine.

My code runs fine inside NetBeans. If I do a clean and build it suggests this:

C:\Program Files\Java\jdk1.7.0/bin/java -jar "C:\Users\User1\Documents\NetBeansProjects\Facebook\dist\Facebook.jar"

This does not work from the DOS prompt of course because of the space between program and files so I do this:

C:\Program Files\Java\jdk1.7.0/bin/java -jar "C:\Users\User1\Documents\NetBeansProjects\Facebook\dist\Facebook.jar" -jar "C:\Users\User1\Documents\NetBeansProjects\Facebook\dist\Facebook.jar"

This works from the DOS prompt.

I now create a task in Windows Scheduler to run:

C:\Program Files\Java\jdk1.7.0/bin/java

with arguments:

-jar "C:\Users\User1\Documents\NetBeansProjects\Facebook\dist\Facebook.jar"

When I then run it, all I see is a DOS box flashing up for a second. I expect the code to take about 30 secs to run. The code should persist data to a database and no updates happen.

The code also uses java.util.logging so I should see log entries and I don’t.

I strongly suspect that I am not running the JAVA command properly or that there’s a bad classpath issue that it present when running via Scheduler that isn’t there when running from the DOS prompt.

Help would be appreciated. If you’ve seen this before and can sort it that would be great. If you can tell me how to get a meaningful error trace from Scheduler than that would also be really helpful.

Thanks!

  • 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-06-09T22:51:01+00:00Added an answer on June 9, 2026 at 10:51 pm

    I Think that you could create a simple batch script that will launch your program in this way :

    @echo off
    REM Eventually change directory to the program directory 
    cd C:\Users\User1\Documents\NetBeansProjects\Facebook\dist\
    REM run the program
    "C:\Program Files\Java\jdk1.7.0\bin\java.exe" -jar "C:\Users\User1\Documents\NetBeansProjects\Facebook\dist\Facebook.jar"
    

    Copy it into the notepad and save as java_script.cmd and then schedule this script instead of the program directly.

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

Sidebar

Related Questions

I'm trying run a simple Java/MySQL web app tutorial in NetBeans. I am able
i am trying to run a very simple java program. i want to write
I am trying to compile and run a simple java class within eclipse. The
I am trying to run this dreadfully simple command in Bash java -cp nasa-top-secret.jar
I'm trying to run exec-maven-plugin 's exec:java goal on a simple two-module project where
I'm trying to run a simple query with PDO in PHP. The code is
I am trying to run a simple SQLITE application on Windows Mobile developed with
I am trying to build a simple java program which creates a db file,
I am just trying to compile and run a very simple test program, but
I'm new to java and trying to write a simple program using JDBC. It

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.