Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > environment variables

Reply
Thread Tools

environment variables

 
 
Bill Cunningham
Guest
Posts: n/a
 
      04-17-2010
I am running MCE XP and am having a very difficult time setting
environment variables. Is javac used anymore for the java compiler or jar
used for jar files anymore? I am also setting up ant to build a tomcat
server from source. I have added to path the path name of my jdk and I can
run java from any folder. Any hints on settings for ant and tomcat?

Bill


 
Reply With Quote
 
 
 
 
Arne Vajh°j
Guest
Posts: n/a
 
      04-17-2010
On 17-04-2010 15:43, Bill Cunningham wrote:
> I am running MCE XP and am having a very difficult time setting
> environment variables. Is javac used anymore for the java compiler or jar
> used for jar files anymore? I am also setting up ant to build a tomcat
> server from source. I have added to path the path name of my jdk and I can
> run java from any folder. Any hints on settings for ant and tomcat?


You should set JAVA_HOME and ANT_HOME env vars and have JDK bin
dir in PATH.

javac and jar are still current.

Arne
 
Reply With Quote
 
 
 
 
Bill Cunningham
Guest
Posts: n/a
 
      04-17-2010
Arne Vajh°j wrote:

> You should set JAVA_HOME and ANT_HOME env vars and have JDK bin
> dir in PATH.


I can't by reading the tutorial see how to do that.

> javac and jar are still current.


I can run java from any location from the DOS box. However javac and jar
do not work.

Bill


 
Reply With Quote
 
Arne Vajh°j
Guest
Posts: n/a
 
      04-17-2010
On 17-04-2010 16:32, Bill Cunningham wrote:
> Arne Vajh°j wrote:
>> You should set JAVA_HOME and ANT_HOME env vars and have JDK bin
>> dir in PATH.

>
> I can't by reading the tutorial see how to do that.


On Windows you set them in:
control panel
system
advanced
environment

Be very carefully not to delete anything existing!

>> javac and jar are still current.

>
> I can run java from any location from the DOS box. However javac and jar
> do not work.


If you have installed JDK, then that indicates that you have
not Java bin dir in PATH.

Arne
 
Reply With Quote
 
Martin Gregorie
Guest
Posts: n/a
 
      04-17-2010
On Sat, 17 Apr 2010 16:32:09 -0400, Bill Cunningham wrote:

> Arne Vajh├Şj wrote:
>
>> You should set JAVA_HOME and ANT_HOME env vars and have JDK bin dir in
>> PATH.

>
> I can't by reading the tutorial see how to do that.
>

Its basic operating system stuff. See your XP documentation or use a
search engine for XP and search part or environment variable.

>
> I can run java from any location from the DOS box. However javac and
> jar
> do not work.
>

Fix your search path.


--
martin@ | Martin Gregorie
gregorie. | Essex, UK
org |
 
Reply With Quote
 
markspace
Guest
Posts: n/a
 
      04-17-2010
Bill Cunningham wrote:
> Arne Vajh°j wrote:
>
>> You should set JAVA_HOME and ANT_HOME env vars and have JDK bin
>> dir in PATH.

>
> I can't by reading the tutorial see how to do that.



Just curious: which tutorial do you mean? Do you have a link?

 
Reply With Quote
 
Bill Cunningham
Guest
Posts: n/a
 
      04-17-2010

"markspace" <(E-Mail Removed)> wrote in message
news:hqdapa$pc4$(E-Mail Removed)-september.org...

> Just curious: which tutorial do you mean? Do you have a link?
>


http://ant.apache.org/manual/index.html

For ant . I also tried old dos paths by writing my own batch file that says
this.

@echo off
set path=c:\progra~1\java\jdk1.6.0_u20\bin;%path%

;That works with java. But not javac or jar.

set classpath=c:\progra~1\java\jdk1.6.0_u20\lib\tols.j ar;%classpath%

I don't know if the above set works or not. As far as these ANT_HOME and
JAVA_HOME I have no idea what to do with them.

Bill


 
Reply With Quote
 
Arne Vajh°j
Guest
Posts: n/a
 
      04-17-2010
On 17-04-2010 18:27, Bill Cunningham wrote:
> For ant . I also tried old dos paths by writing my own batch file that says
> this.
>
> @echo off
> set path=c:\progra~1\java\jdk1.6.0_u20\bin;%path%
>
> ;That works with java. But not javac or jar.


It should work with javac and jar.

Does that directory contain the two exe's?

> set classpath=c:\progra~1\java\jdk1.6.0_u20\lib\tols.j ar;%classpath%


You should not set CLASSPATH.

> I don't know if the above set works or not. As far as these ANT_HOME and
> JAVA_HOME I have no idea what to do with them.


JAVA_HOME should point to the root of Java (not the bin dir).

It is used by many tools to locate Java.

Similar for ANT_HOME and ant.

Arne

 
Reply With Quote
 
Bill Cunningham
Guest
Posts: n/a
 
      04-17-2010
Arne Vajh°j wrote:

> Does that directory contain the two exe's?


Yes. So classpath isn't set anymore to the tools.jar?

Bill


 
Reply With Quote
 
Arne Vajh°j
Guest
Posts: n/a
 
      04-17-2010
On 17-04-2010 19:02, Bill Cunningham wrote:
> Arne Vajh°j wrote:
>> Does that directory contain the two exe's?

>
> Yes.


Then if the directory is in PATH then the two commands
should work.

> So classpath isn't set anymore to the tools.jar?


Correct.

CLASSPATH is a bad idea from the mid 1990's.

Arne


 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Put variables into member variables or function variables? tjumail@gmail.com C++ 9 03-23-2008 04:03 PM
70-284 Lab Environment, Need Virtual Environment brooklynbridge508@hotmail.com MCSA 4 05-02-2007 09:49 AM
Setting an environment variable from another environment variable marcwentink@hotmail.com Java 5 04-04-2007 10:39 PM
Setting Environment Variables Rick Kasten Perl 2 07-07-2004 07:43 PM
how to set .net environment variables - a one time setting by the administrator =?Utf-8?B?YnNmbDQ0?= ASP .Net 0 05-12-2004 12:56 PM



Advertisments