• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 136
  • Last Modified:

shortcut to execute java program

I would have a java program that is to be run by some non technical users. I want to create a short cut to that program on the desktop so that when the user clicks on it the program is executed. I also want the output/errors to be redirected to a directory.

the java program is in c:\javaproject\HelloWorld.java
the log is in c:\temp\java.log.
  • 2
1 Solution
Why not create a batch file
Open notepad
Type (without quotes)
"java HelloWorld >> c:\temp\java.log"

then save it as HelloWorld.bat

Now doublicking on it should save the output to the temp folder

Note: java Helloword is how I am assuming you run the program using the command line, if not then just replace it with what you use.
Hope I could help
"java c:\javaproject\HelloWorld >> c:\temp\java.log"

Actually you need the full path if you want to run it from your desktop
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now