Calum1577
Member
Registered: 30th Jan 04
Location: Troon
User status: Offline
|
Got a .bat file which it says is an MS-DOS batchfile. It automaticully runs a java applet. What i want to know though is how to break the batch down to its individual components ie the java file, html file and automatic running file. Cheers.
|
James_DT
Member
Registered: 9th Apr 04
Location: Cambridgeshire
User status: Offline
|
Open the .bat in Notepad.
|
Calum1577
Member
Registered: 30th Jan 04
Location: Troon
User status: Offline
|
Tried that mate. It says this:
@echo off
rem The commands below should be edited if Java is not
rem installed in any of the folders c:\j2sdk1.4.2_03, ...05, ...06
if exist c:\j2sdk1.4.2_03 (
set JAVALOCATION=c:\j2sdk1.4.2_03
) else (
if exist c:\j2sdk1.4.2_05 (
set JAVALOCATION=c:\j2sdk1.4.2_05
) else (
if exist c:\j2sdk1.4.2_06 (
set JAVALOCATION=c:\j2sdk1.4.2_06
) else (
echo Cannot find a Java installation
echo Please edit RunDemo.bat manually
pause
exit
)))
%JAVALOCATION%\bin\appletviewer AccommodationDemo.html
Any idea's??
|
Ian
Site Administrator
Registered: 28th Aug 99
Location: Liverpool
User status: Offline
|
First 2 lines check if that folder exists and if so sets JAVALOCATION to be the folder, else lines 4 and 5 do the same for a different folder, else lines 7 and 8 the same for another folder, else say 'Cannot find Java installation blah blah.
Then it opens appletviewer from the bin folder in your Java installation and passes the name of the accomodation demo in there.
Not so complicated. You may also open the HTML file in notepad for more information but if you have a compiled Java applet that is all you're going to get, they're not so easy to dissassemble.
|
John
Member
Registered: 30th Jun 03
User status: Offline
|
What is it you're wanting the batch to end up doing?
|
Calum1577
Member
Registered: 30th Jan 04
Location: Troon
User status: Offline
|
well at the moment the batch works and will open up the applet that has been created. However what i want is the acctual java code used to create the applet. You with me? Cheers Ian but hoping someone will be able to work this one out.
|
Tim
Site Administrator
Registered: 21st Apr 00
User status: Offline
|
You need to decompile the class file to get the sourcecode. Use 'jad' (do a Google).
There's a Windows GUI for jad too which is useful... called FrontEnd Plus (again Google)
|
Ian
Site Administrator
Registered: 28th Aug 99
Location: Liverpool
User status: Offline
|
Yeah the batch just runs some stuff and the HTML code is just a wrapper for positioning of the applet perhaps.
Java source code you probably don't have and can't get to as the applet is compiled.
|
Ian
Site Administrator
Registered: 28th Aug 99
Location: Liverpool
User status: Offline
|
Or alternatively, use some nifty haxor tools like that hehe
|
Tim
Site Administrator
Registered: 21st Apr 00
User status: Offline
|
quote: Originally posted by Ian
Java source code you probably don't have and can't get to as the applet is compiled.
Easy to decompile though as it's all in bytecode (to make java so portable -- and SLOW)...
|
Calum1577
Member
Registered: 30th Jan 04
Location: Troon
User status: Offline
|
Tim if i was able to send u the bacth file would u be able to return to me the html and java source code?
|
Ian
Site Administrator
Registered: 28th Aug 99
Location: Liverpool
User status: Offline
|
No! The batch file is just the instructions of what to do, and opens in Notepad.
The java code can be disassembled using a program called jad as Tim posted just now. Search google for it and install and use it. If you can't sort that then programming Java is going to be a bit of a challenge.
Is this degree related or something?
|
Calum1577
Member
Registered: 30th Jan 04
Location: Troon
User status: Offline
|
Not totally degree related Ian. I want access to the source code of a program similar to one i need to do. I got that Jad program but it wasnt for working on the Uni comps. Hence why i asked if possible for Tim to decompile it for me. So as for java being a challenge then i would say its a challenge to anyone who has just started to learn it let alone someone who can or cannot instal and run a program. Felt that was a bit harsh and uncalled for man.
|
Swiftie
Member
Registered: 7th Jan 05
Location: Greater London
User status: Offline
|
If it wasn't working for you in the uni comps it could be because it needs installing and you haven't got sufficient rights to do so. If you got a PC at home then try it there
|
Calum1577
Member
Registered: 30th Jan 04
Location: Troon
User status: Offline
|
Hey guys thanks for all help. Got it done now.
|
Ian
Site Administrator
Registered: 28th Aug 99
Location: Liverpool
User status: Offline
|
Yeah didn't know it was a privs thing, thought you were being lazy and wanting Tim to do something which should be easy. I assume you sorted it once you were able to install stuff yourself?
|
Calum1577
Member
Registered: 30th Jan 04
Location: Troon
User status: Offline
|
Yeah Ian. Got it to work that way but also figured my way around the problem that i wanted to see that ones code for. Took a while like and had to use 4 dif comps but got there in the end.
|
Ian
Site Administrator
Registered: 28th Aug 99
Location: Liverpool
User status: Offline
|
Sound - and hopefully learnt a bit in the process! Uni is all about playing about with stuff and solving problems. I relied on mates too much during my time there and as a result didn't learn as much as I should have in the first years. Just trying to not help you make the same mistake.
|