LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 12-12-2001, 11:46 PM   #1
lolmc
Member
 
Registered: Nov 2001
Location: Wirral.Merseyside - UK
Distribution: Ubuntu 20.04.2 LTS
Posts: 62

Rep: Reputation: 15
Java programming in a shell


Hi, I'm using bash as my shell and I've installed Forte CE from sun and set up my .bashrc script with a JAVA_PATH variable and export and it works fine.
So why post? Well Forte is too big and memory hungry for me at the moment as I'm a beginner and my code is only small so my question is this - how do I set up to be able to call javac mycode.jav from my shell and have it compile etc like you can in Windoze?
I plan to use gedit to write the source and hope to just have a terminal window on screen to run the commands in the bin directory of my jdk directory (jdk1.3).
Hope someone can help and thanks in advance if you do.
 
Old 12-13-2001, 02:40 AM   #2
dorward
Member
 
Registered: Sep 2001
Distribution: Gentoo
Posts: 760

Rep: Reputation: 31
Find the directory with the java binaries in it and add that to your $PATH.

e.g.

export PATH=$PATH:/usr/local/java/jdk1.3.1/bin

Then you can use the normal commands of:

javac MyClass.java
java MyClass

If you feel up to using emacs instead of nedit you can also grab a wonderful mode (with a name that escapes me right now) that gives you some nice Java keybindings and lets you fire off compile and run from within emacs.
 
Old 12-13-2001, 08:12 AM   #3
lolmc
Member
 
Registered: Nov 2001
Location: Wirral.Merseyside - UK
Distribution: Ubuntu 20.04.2 LTS
Posts: 62

Original Poster
Rep: Reputation: 15
Thumbs up


Cheers mate that works a treat!
 
  


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
Java Programming: Java Runtime Environment not found when trying to compile murbz Linux - Software 2 03-26-2009 03:04 AM
java support and programming with java sharapchi Slackware 8 11-14-2005 05:47 PM
programming shell tuls Slackware 3 08-24-2005 05:58 PM
Shell Programming sharadgana Programming 5 12-14-2004 07:42 AM
shell programming shadowsurfer Linux - Newbie 3 09-09-2004 09:40 PM

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

All times are GMT -5. The time now is 05:32 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