Jump to content
  • Advertisement
Sign in to follow this  
Halsafar

[java] Linux and Java -- run and compile from shell

This topic is 4834 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Okay at my university all comps are Linux boxes. I myself got Ubuntu working fine duel booting with WinXp via the NTBootLoader. Installed the KDE (Kubuntu), and em happily enjoying Linux. Now, I installed the JR5+Netbeans SDK, that all went fine. However I am still running into a delima I don't know how to solve. On the comps at school it is easy as typing "javac class.java" to compile and "java class" to run. I wish to have the same functionality but I do not. What do I have to configure within Linux to be able to compile and run java.

Share this post


Link to post
Share on other sites
Advertisement
How on earth do I append
export PATH=$PATH:~/j2sdk1.4.2/bin
to the .bashrc on the root drive...

I cannot make heads or tails of "vi"
I also cannot figure out how to change the permissions so I can edit the /root/.bashrc file from the GUI.

Share this post


Link to post
Share on other sites
Quote:
Original post by Halsafar
How on earth do I append
export PATH=$PATH:~/j2sdk1.4.2/bin
to the .bashrc on the root drive...

First, it is my opinion that vi is overkill for simple tasks like this, just use nano to edit the file. Furthermore, you don't need to export the path on the root account - it's only relevant for any account that will run or compile Java programs. Since you shouldn't be using root for such tasks, you only need to modify your .bashrc. To do this, open a terminal and type :

[will@localhost] > nano -w ~/.bashrc
** nano will pop up, as will the contents of your bashrc file
** go to the bottom and type
export PATH=$PATH:~/j2sdk1.4.2/bin (or whatever your Java path is)

Hit Ctrl + X (save), type "Y", and press Enter.

All done.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!