Click to See Complete Forum and Search --> : Java Compiler
Bhima
07-12-2003, 07:54 AM
Hi.
I need to know where to get a Java Compiler that will Compile Source code (.JAVA Files) into .CLASS or .JAR files.
I've searched the net but I get loads of .ZIP files saying they have a compiler inside but have about 10000 .CLASS files packed inside instead.
I have found programmes that do .CLASS > .JAVA but not hte other way round.
HELP!!!
Bhima
07-12-2003, 07:56 AM
Hi.
I know this is not javascript but I need to know where to get a Java Compiler that will Compile Source code (.JAVA Files) into .CLASS or .JAR files.
I've searched the net but I get loads of .ZIP files saying they have a compiler inside but have about 10000 .CLASS files packed inside instead.
I have found programmes that do .CLASS > .JAVA but not hte other way round.
HELP!!!
blufive
07-12-2003, 08:55 AM
Go here:
http://java.sun.com/j2se/1.4.2/download.html
You want the "J2SE v1.4.2" section (Java 2 Standard Edition)
You want to download using one of the links in the column headed "SDK" (Software Developer's Kit)
That should give you javac, the Sun java compiler
Khalid Ali
07-12-2003, 09:08 AM
Go to the link below
http://java.sun.com/j2se/1.4.2/download.html
download version appropriate for your OS.
Install the software(latest version j2sdk1.4.2
once all installed.
then set the environment vriable on windows 2000 machines
click on start
select settings
then select control panel
from the control panel select System.
From System select the Advanced tab
from the advanced select Environment Variables
Now in the dialogue box
top section is for user related variables... underneath that there are 3 buttons
"New" "Edit" "Delete"
click on New
in the samll dialogue box first entry is for
Variable name
enter the JAVA_HOME
in the variable name text field
Second is Variable value,this value will be the root folder of j2sdk on your machine onwindows if you did not mess with installation it will be
C:\j2sdk1.4.2
enter that value(make sure its the same opn your machine)once you entered both values it should look like this
Variable name JAVA_HOME
Variable value C:\j2sdk1.4.2
Once that is done then scroll down in the user variables list and locate where it says PATH on the left side,
Select the path in the viewable area so that its "blued" then click on Edit button.
it will display a small dialogue box.In the second line where it says variable values, select the text in the text field and move your cursor all the way to the right.make usre the entry already there is separated by a semi colon;(each entry here is separated by a semi colon.
Now copy the line below and paste it in there
%JAVA_HOME\bin;%JAVA_HOME%\lib;
now click ok and open a dos window by
click on start
click on run
in the text field type in this
cmd
it will open a dos propmpt
type in the following
\> java
it should give you a list of java valid commands
if it does then
retype this
javac
it should give you another list
otherwise go back to the variable settings and see if all is pointing to correct directories.
If all goes well....then cd to the folder where you have *.java files
to compile a java file the following command will work cd to the folder that contains a java file
\>javac mytest.java
if it compiles it will go to the prompt again else will give you errors.
if it compiles then u can run your app using this
\>java mytest
notice that a class file does not need to be appended with .class
I hope this helps
Khalid Ali
07-12-2003, 09:52 AM
I just noticed that you have another thread for the same topic opened in General forum..its nice please do not cross post.