|
-
Mar 9th, 2001, 09:40 PM
#1
Thread Starter
Hyperactive Member
I just downloaded the java 2 sdk newest version.
I know how to write simple applets but how do I compile them?
-JR-
-
Mar 10th, 2001, 07:41 PM
#2
Dazed Member
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.
-
Mar 10th, 2001, 08:22 PM
#3
Thread Starter
Hyperactive Member
-
Mar 10th, 2001, 08:40 PM
#4
Dazed Member
-
Mar 10th, 2001, 08:43 PM
#5
Thread Starter
Hyperactive Member
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 ...
-JR-
-
Mar 10th, 2001, 08:51 PM
#6
Dazed Member
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.....
-
Mar 16th, 2001, 06:53 PM
#7
Thread Starter
Hyperactive Member
Hey buddy still following this thread?
(Could use some help )
-JR-
"Blessed are we who can laugh at ourselves for we shall never cease to be amused"
- Unknown
-
Mar 19th, 2001, 11:32 AM
#8
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.
-
Mar 19th, 2001, 03:44 PM
#9
Thread Starter
Hyperactive Member
Ahem, please, I'm a mortal ...
But what should I do to get that classpath to be a default or something?
-JR-
"Blessed are we who can laugh at ourselves for we shall never cease to be amused"
- Unknown
-
Mar 19th, 2001, 09:56 PM
#10
-
Mar 20th, 2001, 12:47 AM
#11
Thread Starter
Hyperactive Member
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-
"Blessed are we who can laugh at ourselves for we shall never cease to be amused"
- Unknown
-
Mar 20th, 2001, 06:36 PM
#12
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.
-
Mar 20th, 2001, 07:02 PM
#13
Thread Starter
Hyperactive Member
When I am in the directory in which the .java file is and I say (on windows 2000 command prompt):It gives me an error saying:
Code:
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/tools/javac/Main
-JR-
"Blessed are we who can laugh at ourselves for we shall never cease to be amused"
- Unknown
-
Mar 20th, 2001, 07:10 PM
#14
Dazed Member
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.
-
Mar 20th, 2001, 07:14 PM
#15
Thread Starter
Hyperactive Member
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-
"Blessed are we who can laugh at ourselves for we shall never cease to be amused"
- Unknown
-
Mar 20th, 2001, 07:59 PM
#16
Dazed Member
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
-
Mar 20th, 2001, 09:23 PM
#17
Thread Starter
Hyperactive Member
"Blessed are we who can laugh at ourselves for we shall never cease to be amused"
- Unknown
-
Mar 21st, 2001, 06:16 PM
#18
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|