LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-25-2003, 10:16 AM   #1
nodger
Member
 
Registered: Oct 2003
Location: Ireland
Distribution: Slackware 9.1, Ubuntu
Posts: 192

Rep: Reputation: 30
Compiling Java under Linux


I downloaded and installed the Java runtime library under Linux (redhat 9)
What do I have to do to compile java programs under this? do I need another library?
 
Old 10-25-2003, 10:59 AM   #2
peace
Member
 
Registered: Jul 2003
Location: Canada
Posts: 214

Rep: Reputation: 31
I downloaded the Java Software Development Kit (SDK), it has both the Java compiler (javac) and the Java Virtual Machine.
 
Old 10-25-2003, 11:12 AM   #3
vanquisher
Member
 
Registered: Aug 2003
Location: Hyderabad, India
Posts: 126

Rep: Reputation: 15
create a file called java.sh in ur /etc/profile.d...

add the code below:
Code:
java_path="path to your jdk download directory/bin";
PATH=$java_path:$PATH;
then, do
$ source /etc/profile.d/java.sh
both commands `javac' and `java' should work fine now...when you say
$ which javac, the result should be something like
/the path of j2dk directory/bin/

no other libraries are needed AFAIK, and you can always RTFM
hope this helps
 
Old 10-25-2003, 11:15 AM   #4
vanquisher
Member
 
Registered: Aug 2003
Location: Hyderabad, India
Posts: 126

Rep: Reputation: 15
forgot to add...for compiling, you can say
$ javac yourJavaProg.java
then run it with
$java yourJavaProg

for applets, you get the applet viewer.
Happy Hacking!!!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
compiling java chestud_it Programming 1 10-06-2004 01:30 PM
Having trouble compiling/running java on linux nejiron Linux - Software 12 11-11-2003 12:38 AM
Compiling Java embalmedlenin Programming 3 08-28-2003 06:57 PM
compiling JAVA JIV Programming 8 03-28-2003 11:05 PM
Help compiling java gonus Linux - Software 4 08-05-2002 12:37 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration