• Post Reply Bookmark Topic Watch Topic
  • New Topic

Sorry again after so much time - Path problems  RSS feed

 
holger alberty
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey folks, long time since i've been here. I've got the same problem as the last time i've posted here.
This time it's because i am still on a XP machine (yeah i know, i shouldn't use it, but it's not my PC it's my parents).
I have no user specific variable but i have a CLASSPATH, Path and the JAVA_HOME variable in system.

I go to the cmd get in the directory where i have the typical first "MooseGreetings.java" uncompiled and when i write : javac MooseGreetings.java, i get: it's written false and/or not to be found -,- i'd really could use some hel again!

Thanks a lot in advance!
 
Tony Docherty
Bartender
Posts: 3271
82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is your CLASSPATH set to?
What package is your MooseGreetings class in or is it in the default package?
 
holger alberty
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey there Tony.

My CLASSPATH has the following value:

CLASSPATH C:\Programme\Java\jre7\bin
JAVA_HOME C:\Programme\Java\jre7\bin

And no user defined variabel.

Greets Holger
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have the path to the bin directory of your JDK (not JRE) in your PATH (not CLASSPATH) environment variable ?
And what's the exact error message you are getting ? Don't paraphrase it - copy and paste it.
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
holger alberty wrote:My CLASSPATH has the following value:

CLASSPATH C:\Programme\Java\jre7\bin
JAVA_HOME C:\Programme\Java\jre7\bin

First of all, to be able to compile Java source code, you need to install the JDK (Java Development Kit), not the JRE (Java Runtime Environment). Did you install the JDK, or did you install only the JRE? If you don't have the JDK, then you have to download and install it first.

Second, your CLASSPATH should not point to the 'bin' directory of the JDK or JRE installation. In fact, it is better to not set the CLASSPATH environment variable at all. If it is not set, Java will take the current directory as the classpath.

You don't need to set JAVA_HOME at all. It is not used by the Java compiler or Java app launcher itself. Some third-party software needs it, but it is not necessary for compiling and running Java programs.

What you have to do after installing the JDK is set the PATH environment variable, as described in the installation instructions.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!