PDA

Click to See Complete Forum and Search --> : Helpless...


Jareware
Mar 9th, 2001, 08:40 PM
I just downloaded the java 2 sdk newest version.

I know how to write simple applets but how do I compile them?


-JR-

Dillinger4
Mar 10th, 2001, 06:41 PM
Im pretty sure that that an applet is compiled the same
as a normal .java source file... since an applet is still
a class.

If you dont hava FORTE or some other IDE then you
would goto DOS and compile from the command line ie...
C:\ javac -classpath C:\Java\myclasses; myapplet

if you dont have the classpath set in your autoexec.bat then the -classpath option is nessary to tell java where
to look for your classes.

Jareware
Mar 10th, 2001, 07:22 PM
Ooookaay...


-JR-

Dillinger4
Mar 10th, 2001, 07:40 PM
Any Luck?

Jareware
Mar 10th, 2001, 07:43 PM
I think I'll hang on with VB for a little while and do my java @ school where people who know a little more about stuff have made everything simple enough for me to use them :D...


-JR-

Dillinger4
Mar 10th, 2001, 07:51 PM
Yeah Java is cool but to do anything Graphical it is a pain in the ass. I stuck with VB for a while then went into VBA programming for Access which is interesting.
Well gotta go do some drinking..... check you later
Good Luck.....

Jareware
Mar 16th, 2001, 05:53 PM
Hey buddy still following this thread?

(Could use some help :rolleyes: )


-JR-

Mar 19th, 2001, 10:32 AM
What goal are you trying to accomplish?
What are you doing to accomplish this goal?
What is the result?

Perhaps this should have had the ".java" extension:
C:\javac -classpath C:\Java\myclasses; myapplet.java

Dilenger4 was saying that you might be able to get away with:
C:\javac YourAppletClassName.java
if your classpath is set correctly, if not, add the "-classpath" option.

I've never tried this with the semicolon
C:\javac -classpath C:\Java\myclasses; myapplet.java
but I don't think that would be a problem.

Jareware
Mar 19th, 2001, 02:44 PM
Ahem, please, I'm a mortal :D...

But what should I do to get that classpath to be a default or something?


-JR-

Mar 19th, 2001, 08:56 PM
Check http://forums.vb-world.net/showthread.php?s=&threadid=60522 for some ways. I liked Dilenger4's technique.

Jareware
Mar 19th, 2001, 11:47 PM
Yes, I actually took a look at that before posting, and doesn't it have to do just with calling the class file from an html one?


-JR-

Mar 20th, 2001, 05:36 PM
If set in general, then I believe any application that desires to use the "classpath" variable will have that available to it.

I think you should repost your question. (In this thread or a new one). I don't know what you need at this time.

Jareware
Mar 20th, 2001, 06:02 PM
When I am in the directory in which the .java file is and I say (on windows 2000 command prompt):javac ArcTest.javaIt gives me an error saying:Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/tools/javac/Main
-JR-

Dillinger4
Mar 20th, 2001, 06:10 PM
Try compiling from the bin. That is where the javac compiler can be found... So at the DOS prompt i usually
change directories to C:\jdk1.3\bin
then i type in javac C:\Java\myclassname.java
if you notice the Java is just a user defined directory
where i put my stuff.

Jareware
Mar 20th, 2001, 06:14 PM
Wow, thanks bud, it's working now!

Not to whine, but is it possible for a beginner to "globalize" the classpath (i.e. you don't have to go to the bin dir every time you compile)?


-JR-

Dillinger4
Mar 20th, 2001, 06:59 PM
Yes you can set your class path globally. But i dont think that will allow you to compile from another directory
besides the bin. If you set your classpath locally you
can omit the -classpath option at runtime though.
ie java -classpath C:\Java; Myclassname

Jareware
Mar 20th, 2001, 08:23 PM
OK, thanks,


-JR-

Mar 21st, 2001, 05:16 PM
Yes you can set your PATH globally as well as your CLASSPATH.

The PATH tells your operating system where to search for javac.exe and java.exe (actually any program that you "request to launch" off of the command line), the CLASSPATH tells javac.exe where to find other *.class files.

Maybe something like:
PATH = %PATH%;c:\jdk1.3\bin