Hi buddies,

I m trying to rename the existing .jar file.But I can't.
If I make a copy of this and run the copied exe,by that time it works.

Code as follows,

boolean ReNameExistingEXE(String Dest)
	{
		String temp = Dest + "\\Star.jar";
		File s = new File(temp);
	
		String exName = Dest+"\\"+"Old "+s.getName();
		File s1 = new File(exName);
		boolean st = s.renameTo(s1);
		return st;
	}

pls help to make this work.

Recommended Answers

you can't make that work, as Windows will not allow files that are open by another process to be renamed.

Under Unix OSs it might work.

Jump to Post

All 4 Replies

you can't make that work, as Windows will not allow files that are open by another process to be renamed.

Under Unix OSs it might work.

Thanks,

As I know, Windows can allow the MFC exe's to rename while running,but jar file ,i think JVM wont allow.

I try to rename .jar file but i cant that work so i request to u help me.
please........

I try to rename .jar file but i cant that work so i request to u help me.
please........

start your own thread instead of re-opening an old one, and give more information as to what you are trying to accomplish and what you have tried so far

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.