943,929 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 1976
  • Java RSS
Apr 8th, 2006
0

what are "prejava" files?

Expand Post »
I'm a total nubie. I thought it would be useful to download the source for an applet and study the code. I picked a wonderful applet by Don Hatch:
http://www.plunk.org/~hatch/HyperbolicApplet/?size=513. The code in the jar file is all in .prejava files. My IDE (NetBeans) doesn't know what to do with these files. When I rename the extension of the main class source from .prejava to .java I get a lot of errors. Can anyone help me understand what .prejava files are and how to work with them?
Thanks.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
SRWenner is offline Offline
6 posts
since Apr 2006
Apr 8th, 2006
0

Re: what are "prejava" files?

The .prejava files are actually his .java files. You'll have to rename each .prejava file to .java. Once that is done your ide shouldn't have any more errors.
Reputation Points: 11
Solved Threads: 8
Posting Whiz in Training
hooknc is offline Offline
216 posts
since Aug 2005
Apr 8th, 2006
0

Re: what are "prejava" files?

hooknc,
I tried what you suggested: I changed the extension on all 15 .prejava files to .java (before, I had only changed the extension on the source for the main class). I got the same errors as before. I noticed that Don has a file called "javacpp" (without an extension). Within my IDE I could read that file, which says that javacpp "Runs the C preprocessor (cpp) on .prejava files to create .java files". I tried to run javacpp at the DOS prompt to create the .java files, without success (DOS said it couldn't find an executable by that name). Any suggestions?
Thanks.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
SRWenner is offline Offline
6 posts
since Apr 2006
Apr 9th, 2006
0

Re: what are "prejava" files?

hooknc,
A further note: I added the .exe extension to javacpp and ran "javacpp mainclass.prejava" at the DOS prompt (after setting all the .java extensions back to .prejava). This hung up the DOS cmd.exe with 100% of my CPU dedicated to ntvdm.exe. Any ideas?
Thanks.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
SRWenner is offline Offline
6 posts
since Apr 2006
Apr 9th, 2006
0

Re: what are "prejava" files?

He has built this applet using a linux machine and so all his scripts will only run on linux. So, trying to run the scripts on a windows machine most likely will not work.

Overall I'm not exactly sure what he is doing (I'm not very good with c or linux scripts). But, this is not how a majority of java developers do their development and is most likely not a good example to learn java or java applets.

If still want to try and fallow what he is doing... I would recommend decompiling his java files instead of reading the .prejava files. There are numerous free java decompilers if you do a search on google.
Reputation Points: 11
Solved Threads: 8
Posting Whiz in Training
hooknc is offline Offline
216 posts
since Aug 2005
Apr 9th, 2006
0

Re: what are "prejava" files?

hooknc,
Thanks for the advice. I was attracted to Don Hatch's applet both because I am interested in the subject (hyperbolic tessellations), and because it seemed to be a very well designed program. Maybe I should concentrate on very simple things until I gain some experience with Java. I sent Don an email asking for his help; if he can't help me, maybe I'll try the decompiler approach. I greatly appreciate you taking the time to help me out. I think it would be nearly impossible for beginners to get started without the help of people like yourself.
Kind regards,
Steve
Reputation Points: 10
Solved Threads: 0
Newbie Poster
SRWenner is offline Offline
6 posts
since Apr 2006
Nov 3rd, 2008
0

Re: what are "prejava" files?

You can try DJ Java Decompiler: http://members.fortunecity.com/neshkov/dj.html or http://www.neshkov.com/

DJ Java Decompiler is Windows 95/98/Me/NT/2000/XP/2003/Vista decompiler and disassembler for Java that reconstructs the original source code from the compiled binary CLASS files (for example Java applets).
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Atanas67 is offline Offline
1 posts
since Nov 2008
Nov 3rd, 2008
0

Re: what are "prejava" files?

This thread is from 2006!

Quote ...
He has built this applet using a linux machine and so all his scripts will only run on linux. So, trying to run the scripts on a windows machine most likely will not work.
The whole point is java is platform independant. It is CORA. Compile to bytecode once, run (in the VM) anywhere

Quote ...
Overall I'm not exactly sure what he is doing (I'm not very good with c or linux scripts). But, this is not how a majority of java developers do their development and is most likely not a good example to learn java or java applets.
yeah it looks like crap
Moderator
Featured Poster
Reputation Points: 1784
Solved Threads: 574
Moderator
jbennet is offline Offline
16,520 posts
since Apr 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: Iterating through a collection
Next Thread in Java Forum Timeline: documentation





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC