File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes compiler difficulty Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "compiler difficulty" Watch "compiler difficulty" New topic
Author

compiler difficulty

T Shaw
Greenhorn

Joined: Jul 29, 2012
Posts: 27
Typing java -version in the command box tells me I'm running 1.6.0_31, and javac -version tells me I'm running 1.7.0_05. I have been informed this is the reason that programs I compile using javac spit out a large error message when I run them with the java command.

I just installed JDK 7 today, and apparently at the same time got JRE 7, but there was still a JRE 6 installed. I uninstalled it, hoping that would solve the problem, but the problem persists. Unfortunately, most solutions for this problem which I've found have been written for older operating systems, and I do not understand much about how to fiddle with windows settings. I'm runing Windows 7 Home Premium Version 6.1 (build 7600).

Do you need to know anything else to help me? Thanks.
T Shaw
Greenhorn

Joined: Jul 29, 2012
Posts: 27
Addendum: I have another installation of JRE 6 in 64 bit still installed. Should I remove that as well?
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18843
    
  40



You don't need to uninstall any JVMs ... just remove the JVM bin directory from PATH, so that it won't use the older JVM.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
T Shaw
Greenhorn

Joined: Jul 29, 2012
Posts: 27
Is this the Path under Control Panel>System Properties>Advanced>Environmental Variables? If so, the older JVM Bin directory already wasn't there. It presently reads:

%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Java\jdk1.7.0_05\bin
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18843
    
  40

T Shaw wrote:Is this the Path under Control Panel>System Properties>Advanced>Environmental Variables? If so, the older JVM Bin directory already wasn't there. It presently reads:

%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Java\jdk1.7.0_05\bin



You may have a JVM installed in one of the system directories. Try moving the Java 7 path to the first position, so that it will be picked up first. You will be also need to restart the cmdtool after you change the system path.

Henry
T Shaw
Greenhorn

Joined: Jul 29, 2012
Posts: 27
ok, now it works.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: compiler difficulty