To run a java program on windows xp startup
hi ,
i have a sample HelloWorld.java program.
i wrote a batch file to run this program as follows:
set PATH=%PATH%;C:\Program Files\Java\jre1.6.0\bin;
cd c:\test
java HelloWorld
This program runs when i click on the bat file.
Next i add this batch file to registry to auto-start on windows startup
However, on windows startup, i get the following:
Exception in thread "main" java.lang.NoClassDefFoundError
Anyone can help me? Thank you in advance!
Hi Sergi,
Thanks for the info. I couldn't able to login because of my internet connection.
Thanks,
--Srini
Similar Messages
-
How to run a java program in windows 2003 server from unix server.
Hi ,
I want to run a java program in windows 2003 server from unix machine ..
will RMI helps me to obtain this.
Please tell me the procedure to do this.
Thanks in advance,rmi,web services,corba,web 2.0,xml,xls,dtd,rss,ruby on rails,https,soap,tags,blog,podcast,google
-
Can I run my java program in windows environment?
How can i make my compiled java program run into windows environment?
What program will i use to be able to do that?1. Install the JRE.
2. Go to the command line.
3. Type something like java myClass or java -jar myJar.jar.
You could also use one of the many java2exe (java to executable) programs floating out there. -
Opening a Word Document with a Java program in Windows
When running a Java program in Windows, is it possible to have a button where when it is clicked it will open a Word document?
If so, is it hard and can someone tell me how to do it??
Thankstry this instead of Excel.exe you have to use Word.exe
1. Declare your button
JButton butexlcom = new JButton("Carnet Offre");
butexlcom.addActionListener( new ButExlCommercial(msgout));
butexlcom.setBounds(215,510,110,30);
c.add( butexlcom );
2. run your word document.
class ButExlCommercial implements ActionListener {
private JTextArea msgout;
public ButExlCommercial( JTextArea msg) {
msgout = msg;
public void actionPerformed( ActionEvent e ) {
try {
Runtime.getRuntime().exec("c:\\Program Files\\Microsoft Office\\Office\\Excel.exe NameWordDocument");
catch(Exception en) {
msgout.append( "\n*** PROBLEME WORD ***\n" );
} -
I want to run java program on windows environment as background process
Hi all
I want to run java program on windows environment as background processSo command prompt return after executing java command and program on background In Linux we can do this easily �but I do not how to do this in windows
for example look this programe
import java.io.*;
import java.util.*;
public class TestClass {
class ravi extends Thread{
public void run(){
try {
String target_file = "ravind.txt";
File targetfile = new File(target_file);
PrintWriter writer = new PrintWriter(new FileWriter(targetfile)) ;
for (int i =0 ; i < 100 ;i++ ){
Thread.sleep(10000);
writer.println(" ravindra shukla ");
} catch (Exception e) {
e.printStackTrace();
public static void main(String[] args) {
TestClass test1 = new TestClass();
TestClass.ravi r1 = test1.new ravi();
r1.start();
System.out.println(" return from main ");
first i compile this
javac TestClass.java
then i run this by using this command
java TestClass
but becouse i put sleep on threads run function so it takes to much time to get return on command promt .... i want to run this programe as background process so command promt return as soon as i execute java commandThanks dude
This solution �start java TestClass� works fine �. But it does not solve my problem
It opens another black window and that black window persist till the life time of my program
Is it possible application run on complete background without opening another black window �as in Linux -
Running a java program from an icon
I want to run my program from an icon on my desktop. I have a .bat file that I've built a shortcut to and it works.MY GUI program does display and run when I click on the icon. The problem is that the DOS window also shows up behind my GUI.
Is there anyway to prevent the DOS window from showing? Or is there another way to run a Java program without resorting to a DOS command line or running it through FORTE or another IDD?Chris's solution worked well, with one small problem. Once my GUI starts, it takes up the whole screen. Normally when I run it, it appears as a small window.
not a big problem, I can reduce it easily after it starts. But does anyone know a way to make it come up in the reduced size it norally comes up in when I run it from my IDE? -
Running a java program via a batch file
I am unable to run a java program from a batch file that I created.
spiderpackage.EntryPoint is a class file which I am trying to run with a -v option to output something.What should I do to get the output?
echo ^<html^>^<body^>
echo hello^<br^>
call java spiderpackage.EntryPoint -v
echo ^</body^>^</html^>This has nothing to do with java programming. Have a look at the windows help for the call command.
The echo <html> stuff doesn't make sense. What's it for?
The command in you batch file should be:
java -cp . spiderpackage.EntryPoint -v
assuming that java is in the system path, and the EntryPoint.class is in a directory called spiderpackage which is a subdirectory of your current working directory -
Running a Java program at startup in Linux
Hello
How do I run a Java program at startup in Linux? I know in Windows I can put a .bat file in C:\Windows\Start Menu\Programs\StartUp\ directory, but in Linux I have no idea how it is done.
Thank you,
MihaiThis is really a Linux question, not Java.
And then it depends on the version of Linux you are using.
Maybe this will help, otherwise you should try on a forum for your version of Linux. -
Is it possible to run a java program without using the command prompt?
Hi,
I was wondering whether it is possible to run a Java program (not an applet) without using a command line in the command prompt?
Basically I want to run a program that will be continually running in the background and hence I don't want to have a command prompt screen loaded up as well - I just want the program to be running in the task bar.
I know how to run the program in the task bar - but I still need to launch the program from the command prompt - is there anyway I can get a program running without having to start it from the command prompt?
CheersOr create a desktop shortcut (in Windows) or an application launcher ( in Linux GUI).
-
NoClassFoundError exception while running the java program
Hi,
I am getting the following exception while running a java program CSTToGMTToSQL.java
Exception in thread "main" java.lang.NoClassDefFoundError: CSTToGMTToSQL
However, the class file is getting created for this program in the same directory where the program is residing.
Any idea on this ?
Regards
RameshI know that in the past there was an issue with running a particular version of the SDK on a particular version of windows. The resulant error was a ClassNotFoundException. I am not sure about the versions involved.
-
How to start java.exe from a java program in windows ?
Hi,
I did like to know, if its possible to run java.exe from a java program on windows ? The java.exe should be visible from checking the processes that are currently running using the Task Manager on windows.Runtime.getRuntime().exec("java Sample");
-
How can i run my java program with out java language
Hai to every one ..Iam new to java language ...am using windows xp operating system , i did not installed java language in my system .. how can i run a java program with out installing java language... Which files is requied to run java program..?
any one can help me??Hai to every one ..Iam new to java language ...am
using windows xp operating system , i did not
installed java language in my system .. how can i run
a java program with out installing java language...
you ... can ... not ... do ... this
Which files is requied to run java program..?
any one can help me??a JVM. Download it from sun's website.
[url http://java.sun.com/javase/downloads/index.jsp]Download JavaSE here -
How can i run my java program in background process?
hi all,
i am working on desktop monitoring so when i start my program on client machine that is visible to all but i want this program client not visible to all instead of this can be run in background process . so, nobody can see that.
so, how i can do this ?
pls pls help me
thanks in advanced to helper
regards
maulik & riteshthis will run the java program in the background.It'll just use the Windows Java Console instead of the command-line console. It has nothing to do with running as a background process.
Edit: though this might be exactly what the OP wants: not "background process" but "no DOS console". -
Error while running a Java Program
Can anyone help me,
I am getting the following error while running a Java program, Below is the exception thrown, please help.
java.nio.BufferOverflowException
at java.nio.Buffer.nextPutIndex(Buffer.java:425)
at java.nio.DirectByteBuffer.putChar(DirectByteBuffer.java:463)
at org.jetel.data.StringDataField.serialize(StringDataField.java:295)
at org.jetel.data.DataRecord.serialize(DataRecord.java:283)
at org.jetel.graph.DirectEdge.writeRecord(DirectEdge.java:216)
at org.jetel.graph.Edge.writeRecord(Edge.java:288)
at com.tcs.re.component.RESummer1.run(RESummer1.java:505)
java.nio.BufferOverflowException
at java.nio.Buffer.nextPutIndex(Buffer.java:425)
at java.nio.DirectByteBuffer.putChar(DirectByteBuffer.java:463)
at org.jetel.data.StringDataField.serialize(StringDataField.java:295)
at org.jetel.data.DataRecord.serialize(DataRecord.java:283)
at org.jetel.graph.DirectEdge.writeRecord(DirectEdge.java:216)
at org.jetel.graph.Edge.writeRecord(Edge.java:288)
at com.tcs.re.component.RECollectCont.run(RECollectCont.java:304)Ok, let's see. Write the following class:
public class Grunt {
public static void main(String[] args) {
System.out.println("Hello Mars");
}Save it as "C:\Grunt.java", compile by typing:
javac c:\Grunt.javaRun by typing:
java -classpath "C:\" GruntDoes it say "Hello Mars"? If yes, go back to your program and compare for differences (maybe you used the "package" statement?).
Regards -
Running a java program a set number of times
This is a general question. Is it possible to make a java program run only 5 times for the sake of arguement.
Basically I want to write a program that will give the user some flexibility when it will actually run another Java program, but I only want them to be able to say "not now' for a set number of times. When the last time comes the other program will launch. I was initially thinking of the Do Whilw loop, but this needs to work when the program is restarted.
Program starts, it has 5 times it will run before it does something else(doesn't really matter now I think). User takes option "Not Now" and the program ends, but warns the user this will run 4 more times before you will need to do something.
This process will repeat until the user takes the option "Ok install now" or the time limit expires and the install occurs anyway. Can someone point me in the right direction.ok I see so it's like one those programs that you download for free on the internet and they give you a set amount times to use it before you have to pay for it. but in this case when the number of times you use it equals 5 (or when the user clicks ok) a different java app will open automatically.
My first thought would be to Write a Serialized object to disk using objectOutputStream that stores the number of times the application has been opened. and each time the program runs it checks for the serialized object and then you can do something like what I posted before. of course if were worried about security the user could always look for the object and erase it, if so then I guess we would have to come up with another plan of attack
Hope this helps
Maybe you are looking for
-
Error while creating the delivery in ME2O
Hi Gurus, when the shipping depeartment is trying to create the delivery in ME2o to send the components for subcontractor, we are gettign the error message Essential transfer parameters are missing in record: 000001 Please heklp on this one? and as
-
Hello, I changed my Imac hard drive which no longer worked. I installed a hard drive Western Digital 500 GB 7200 rpm SATA3 WD5002AALX 32M Black. Sometimes I see the hard disk in the utility on the Starter CD, but access seems very slow. By cons when
-
Error occured while starting the listener
i have encountered a problem when starting with lsnrctl C:\Documents and Settings\rajesh.parepalli>lsnrctl LSNRCTL for 32-bit Windows: Version 9.2.0.1.0 - Production on 25-SEP-2007 15:22: 06 Copyright (c) 1991, 2002, Oracle Corporation. All rights re
-
What can i do, I dont have icloud on my sistem preference
I have a macbook and iphone and icloud on my iphone but, idont have icloud on my macbook on my sistempreference
-
Armenian Firmware for Nokia 5800
Can anyone help me , how I can make Armenian resource files .r38 for my Nokia 5800 Is there Armenian Firmware for Nokia 5800 ?????