Sridhar,
JDE looks for a prj.el in your current directory and if it does not find one
looks in the parent directory, etc. Therefore if you have different prj.els
it will use the appropriate one from your path and switch automatically.
James
PS.
Alternatively you could use an over-the-top function like make-ibm117 below
to reset your variable names. Here's how I did it.
; UNIX or NT?
(defconst running-x (eq window-system 'x))
(defconst running-win32 (equal (device-type) 'mswindows))
;; Where am I at the moment?
(cond (running-win32
;; evaluates to 0 if found!
(defconst at-home (string-match "JCOOLEY" (getenv "COMPUTERNAME")))
(defconst at-jcp (string-match "JAMESC" (getenv "COMPUTERNAME")))
(cond (at-home (setenv "JAVAHOME" "h:\\utils\\ibm1.1.7"))
(at-jcp (setenv "JAVAHOME" "C:\\utils\\ibm\\jdk1.1.7")))
;; Bash setup on NT
(setq explicit-shell-file-name "bash")
(setq explicit-sh-args '("-login" "-i"))
))
(defun make-ibm117 ()
"Set up IBM JDK1.1.7 environment"
(interactive)
;; just need to upadre the CLASSPATH
(cond
(running-x
(jde-set-variables
'(jde-compile-option-directory "/mnt/dosc/src/current/classes")
'(jde-run-applet-viewer "/usr/local/jdk117_v3//bin/appletviewer")
'(jde-compiler "/usr/local/jdk117_v3//bin/javac")
'(jde-db-debugger (quote ("/usr/local/jdk117_v3//bin/jdb" . "Executable")))
'(jde-run-java-vm "/usr/local/jdk117_v3/bin/java")
'(jde-run-java-vm-w "/usr/local/jdk117_v3//bin/java")
'(jde-global-classpath (quote ("."
"/mnt/dosc/utils/ibm/jdk1.1.7/lib/classes.zip" "/mnt/dosc/src/current/classes"
"/mnt/dosc/src/current/classes/jde.jar" "/mnt/dosc/src/current/classes/bsh.jar"
"/mnt/dosc/utils/swing-1.1beta2/swing.jar"
"/mnt/dosg/utils/JavaWebServer1.1/lib/jws.jar"
"/mnt/dosg/utils/jpython/jpython.jar"
"/mnt/dosc/src/java/ibm/xml4j_2_0_11/xml4jSamples.jar"
"/mnt/dosc/src/java/ibm/xml4j_2_0_11/xml4j.jar"
"/mnt/dosc/src/java/xml-tr2/xml.jar") t)))
)
(t
(jde-set-variables
'(jde-compile-option-directory "c:\\src\\current\\classes")
'(jde-run-applet-viewer (getenv "JAVAHOME") "\\bin\\appletviewer")
'(jde-compiler (concat (getenv "JAVAHOME") "\\bin\\javac"))
'(jde-db-debugger (quote ( (getenv "JAVAHOME") "\\bin\\jdb.exe" .
"Executable")))
'(jde-run-java-vm (concat (getenv "JAVAHOME") "\\bin\\java"))
'(jde-run-java-vm-w (concat (getenv "JAVAHOME") "\\bin\\java"));
;; Make sure that the old bsh jar is removed from /etc/jde/java/lib
;; also C-a v jde-run-java-vm-w to see what it's set to
'(jde-global-classpath (append (list (concat (replace-in-string (getenv
"JAVAHOME") "\\\\" "\\\\\\\\\\") "\\\\lib\\\\classes.zip")) (quote ("."
"c:\\\\src\\\\current\\\\classes" "c:\\\\utils\\\\swing-1.1beta2\\\\swing.jar"
"g:\\\\utils\\\\JavaWebServer1.1\\\\lib\\\\jws.jar"
"G:\\\\utils\\\\jpython\\\\jpython.jar"
"c:\\\\src\\\\java\\\\ibm\\\\xml4j_2_0_15\\\\xml4j.jar"
"c:\\\\src\\\\java\\\\ibm\\\\xml4j_2_0_11\\\\xml4jSamples.jar"
"c:\\\\src\\\\current\\\\classes\\\\jde216.jar"
"c:\\\\src\\\\current\\\\classes\\\\bsh216.jar"
"C:\\\\src\\\\java\\\\xml-tr2\\\\xml.jar"
"g:\\\\lib\\\\oraclejava\\\\oracle-jdbc-815.zip") t) ))))))
Sridhar Vasudevan wrote:
>
> For some of my CORBA projects I need to use jdk1.1.7 and for my other
> projects I use jdk 1.2
> when Im compiling from the command line I usually switch between versions
> by setting PATH=%JAVA_HOME%\BIN;%PATH%
> Is there a way I can set this path variable in the prj.el file so that I can
> switch automatically?. Or is there anyother way I can switch automatically
> by configuring my prj.el??
> Thanks in advance
> -Sridhar
>
> "A distributed computing system is one in which your machine can be rendered
> unusable by the failure of some other machine you
> didn't even know existed"
> -Leslie Lamport
>
> Sridhar Vasudevan
> Concurrent Engineering Research Center WVU
> 886, Chestnut Ridge Road
> Morgantown WV 26506
--
James Cooley [+44 (0)171-6896924]
JCP Computer Services, 16 St Johns Lane, London, EC1M 4BS, UK.
PGP Key ID : 0x28CA7769
fingerprint: A39D 1357 89EF 3707 2D62 050B 6AA1 4D03 28CA 7769