Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to convert a jar/war file of .class files to a folder containing .java files

 
karthik sreeram
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI ,
I want to know how to convert a .jad file to .java file,
i have large number of .jad files[around 4000] to .java files,
is there any tool to do this,
please reply me , if you know about it,
thanks in advance
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15359
39
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can't you just rename the files (*.jad -> *.java)?
 
Chetan Raju
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As per my understanding, you mean to ask how to convert class files to java files. If this is the query then the answer is that you unzip/untar the war/jar files to a folder and then use a decompiler to decompile the classes to java files. DJ Decompiler is one that I can suggest. However, there can be many available on the net.
 
karthik sreeram
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for replying,
what i want exactly is to rename a bulk amount of .jad files to .java files,
is there any tool to rename a directory of files from .jad to .java.
 
Chetan Raju
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ren *.jad *.java should work if im not wrong
 
Jeroen T Wenting
Ranch Hand
Posts: 1847
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Chetan Raju:
ren *.jad *.java should work if im not wrong


if you're on a Windows machine and they're all in the same directory

But the principle is sound, other operating systems have similar commands, some of them may even have an option to recursively process deeper directories.
 
Rajah Nagur
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Write a Java program to rename the files.
 
karthik sreeram
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks the renaming utility is working , but it is renaming the files in the current directory only,
but i want to rename the entire directory tree containing .jad files to .java files, how can i?
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you aware that Jad has an option that allows you to set the extension being used for decompiled files? That way there would be no need to rename the files.
 
karthik sreeram
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks , jad is working ,thanks everyone , i got my solution.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic