corsasport.co.uk
 

Corsa Sport » Message Board » Off Day » More java kinda help


New Topic

New Poll
  Subscribe | Add to Favourites

You are not logged in and may not post or reply to messages. Please log in or create a new account or mail us about fixing an existing one - register@corsasport.co.uk

There are also many more features available when you are logged in such as private messages, buddy list, location services, post search and more.


Author More java kinda help
Calum1577
Member

Registered: 30th Jan 04
Location: Troon
User status: Offline
19th Apr 05 at 17:29   View User's Profile U2U Member Reply With Quote

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
19th Apr 05 at 17:35   View User's Profile U2U Member Reply With Quote

Open the .bat in Notepad.
Calum1577
Member

Registered: 30th Jan 04
Location: Troon
User status: Offline
19th Apr 05 at 17:44   View User's Profile U2U Member Reply With Quote

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

Avatar

Registered: 28th Aug 99
Location: Liverpool
User status: Offline
19th Apr 05 at 17:54   View Garage View User's Profile U2U Member Reply With Quote

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
19th Apr 05 at 17:54   View User's Profile U2U Member Reply With Quote

What is it you're wanting the batch to end up doing?
Calum1577
Member

Registered: 30th Jan 04
Location: Troon
User status: Offline
19th Apr 05 at 18:02   View User's Profile U2U Member Reply With Quote

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

Avatar

Registered: 21st Apr 00
User status: Offline
19th Apr 05 at 18:07   View Garage View User's Profile U2U Member Reply With Quote

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

Avatar

Registered: 28th Aug 99
Location: Liverpool
User status: Offline
19th Apr 05 at 18:08   View Garage View User's Profile U2U Member Reply With Quote

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

Avatar

Registered: 28th Aug 99
Location: Liverpool
User status: Offline
19th Apr 05 at 18:09   View Garage View User's Profile U2U Member Reply With Quote

Or alternatively, use some nifty haxor tools like that hehe
Tim
Site Administrator

Avatar

Registered: 21st Apr 00
User status: Offline
19th Apr 05 at 18:11   View Garage View User's Profile U2U Member Reply With Quote

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
19th Apr 05 at 18:33   View User's Profile U2U Member Reply With Quote

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

Avatar

Registered: 28th Aug 99
Location: Liverpool
User status: Offline
19th Apr 05 at 18:36   View Garage View User's Profile U2U Member Reply With Quote

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
19th Apr 05 at 18:48   View User's Profile U2U Member Reply With Quote

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
19th Apr 05 at 20:01   View User's Profile U2U Member Reply With Quote

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
19th Apr 05 at 20:46   View User's Profile U2U Member Reply With Quote

Hey guys thanks for all help. Got it done now.
Ian
Site Administrator

Avatar

Registered: 28th Aug 99
Location: Liverpool
User status: Offline
19th Apr 05 at 21:46   View Garage View User's Profile U2U Member Reply With Quote

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
19th Apr 05 at 21:59   View User's Profile U2U Member Reply With Quote

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

Avatar

Registered: 28th Aug 99
Location: Liverpool
User status: Offline
19th Apr 05 at 22:01   View Garage View User's Profile U2U Member Reply With Quote

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.

 
New Topic

New Poll

Corsa Sport » Message Board » Off Day » More java kinda help 23 database queries in 0.0099258 seconds