Menu

#160 Can't compile with windows jdk 6.0+02

closed
5
2008-01-18
2007-07-04
hperkins
No

I've been installing Java related things on a recently reformatted windows xp box and discovered that Sun just released a new Java 6 version, 1.6.0_02. I can compile and run Java programs from a command line, but when I tried compiling "hello world" with DrJava beta version 20070524-1944, I got the following error in the compiler message window:

1 error found:
File: (no associated file) [line: (no source location)]
Error: java.lang.NoClassDefFoundError: com/sun/tools/javac/util/Context

The compiler quit at that point and no .class file was produced.

Here's a copy of the system properties window:

System Properties:
DrJava Version 20070524-1944
drjava.debug.port = 1356
java.runtime.name = Java(TM) SE Runtime Environment
sun.boot.library.path = C:\Program Files\Java\jre1.6.0_02\bin
java.vm.version = 1.6.0_02-b05
java.vm.vendor = Sun Microsystems Inc.
java.vendor.url = http://java.sun.com/
path.separator = ;
java.vm.name = Java HotSpot(TM) Client VM
file.encoding.pkg = sun.io
user.country = US
sun.os.patch.level = Service Pack 2
java.vm.specification.name = Java Virtual Machine Specification
user.dir = <anonymized user.dir>
java.runtime.version = 1.6.0_02-b05
java.awt.graphicsenv = sun.awt.Win32GraphicsEnvironment
java.endorsed.dirs = C:\Program Files\Java\jre1.6.0_02\lib\endorsed
os.arch = x86
java.io.tmpdir = C:\DOCUME~1\&lt;anonymized user.name>\LOCALS~1\Temp\ line.separator = "\u000d\u000a"
java.vm.specification.vendor = Sun Microsystems Inc.
user.variant =
os.name = Windows XP
application.home = <anonymized user.dir>
sun.jnu.encoding = Cp1252
java.library.path = <anonymized user.dir>;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Java\jdk1.6.0_02\bin;C:\Program Files\QuickTime\QTSystem\;c:\Program Files\Microsoft SQL Server\90\Tools\binn\ env.class.path = .;C:\Program Files\QuickTime\QTSystem\QTJava.zip
java.specification.name = Java Platform API Specification
java.class.version = 50.0
sun.management.compiler = HotSpot Client Compiler
os.version = 5.1
user.home = <anonymized user.home>
user.timezone = America/Los_Angeles
java.awt.printerjob = sun.awt.windows.WPrinterJob
file.encoding = Cp1252
java.specification.version = 1.6
java.class.path = <anonymized user.dir>\drjava-beta-20070524-1944.exe
user.name = <anonymized user.name>
java.vm.specification.version = 1.0
java.home = C:\Program Files\Java\jre1.6.0_02
sun.arch.data.model = 32
user.language = en
java.specification.vendor = Sun Microsystems Inc.
awt.toolkit = sun.awt.windows.WToolkit
java.vm.info = mixed mode, sharing
java.version = 1.6.0_02
java.ext.dirs = C:\Program Files\Java\jre1.6.0_02\lib\ext;C:\WINDOWS\Sun\Java\lib\ext
sun.boot.class.path = C:\Program Files\Java\jre1.6.0_02\lib\resources.jar;C:\Program Files\Java\jre1.6.0_02\lib\rt.jar;C:\Program Files\Java\jre1.6.0_02\lib\sunrsasign.jar;C:\Program Files\Java\jre1.6.0_02\lib\jsse.jar;C:\Program Files\Java\jre1.6.0_02\lib\jce.jar;C:\Program Files\Java\jre1.6.0_02\lib\charsets.jar;C:\Program Files\Java\jre1.6.0_02\classes
java.vendor = Sun Microsystems Inc.
file.separator = \ java.vendor.url.bug = http://java.sun.com/cgi-bin/bugreport.cgi
sun.io.unicode.encoding = UnicodeLittle
sun.cpu.endian = little
java.rmi.server.hostname = 127.0.0.1
sun.desktop = windows
sun.awt.exception.handler = edu.rice.cs.drjava.ui.DrJavaErrorHandler
sun.cpu.isalist = pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86

#DrJava configuration file
#Tue Jul 03 17:27:35 PDT 2007
key.delete.next = shift DELETE
key.delete.previous = shift BACK_SPACE
recent.files = [C:\\Documents and Settings\\&lt;anonymized user.name>\\Desktop\\Main.java]
window.x = 112
window.y = 34
window.state = 0
last.dir = C:\\Documents and Settings\\&lt;anonymized user.name>\\Desktop\\Main.java
last.interactions.dir = C:\\Documents and Settings\\&lt;anonymized user.name>

Used memory: about 5.89 megabytes
Free memory: about 1.16 megabytes
Total memory: about 7.05 megabytes
Total memory can expand to: about 63.56 megabytes

Discussion

  • hperkins

    hperkins - 2007-07-04

    Logged In: YES
    user_id=728235
    Originator: YES

    Quick followup: I just tried the same thing on a machine with Java 1.6.0_01 installed and got the same error. It also does not seem to matter if the file is on the desktop (directory path containing spaces) or in a file named c:\test\Main.java.

     
  • hperkins

    hperkins - 2007-07-04

    Logged In: YES
    user_id=728235
    Originator: YES

    Second followup for the day (and I'll stop spamming now)...

    The stable DrJava release 20070130-2255 works fine on both systems with both 1.6.0_01 and 1.6.0_02. So it's a problem with the beta, and not with changing from 1.6.0_01 to 1.6.0_02.

     
  • Christopher Warrington

    • milestone: 184338 -->
    • labels: 389637 -->
     
  • Christopher Warrington

    Logged In: YES
    user_id=666678
    Originator: NO

    In some cases, DrJava cannot automatically find the Java compiler. Often, it will display a dialog box indicating that it cannot find "tools.jar". This usually occurs when the Java compiler is either not installed or installed in a non-standard location.

    If you have not yet installed a Java Development Kit (JDK), you can download and install one from http://java.sun.com/javase/downloads/ (Note: Mac OS X users should already have one installed.). Keep in mind that a Java Runtime Environment is not a JDK. You will need to install both to develop with DrJava.

    After installing the JDK, DrJava should be able to find and use the newly installed compiler.

    If you do have a JDK installed, DrJava may be unable to find the compiler. In this case, you can tell DrJava where the compiler is. If the aforementioned "tools.jar" dialog box is displayed, click "Yes" and another dialog will be displayed allowing you to select the location of your "tool.jar" file. If the dialog is not displayed, select "Edit -> Preferences..." and click on the "..." to the right of the "tool.jar" field. This will display the same selection dialog.

    Now that the selection dialog is open, navigate through your file system and select your "tools.jar". On Windows, it can often be found in "C:\Program Files\Java\&lt;jdk version>\lib\tools.jar". If you cannot find it here, search for "tools.jar" across all your hard drives. On Linux\Unix and Mac OS X, typing "locate tools.jar" at a command line can help you locate it.

    If none of these suggestions help, post another comment and we'll try to help you.

    Thanks,
    The DrJava Team

     
  • Christopher Warrington

    • status: open --> pending
     
  • Christopher Warrington

    Logged In: YES
    user_id=666678
    Originator: NO

    We know about this. You'll need to set the tools.jar location.

     
  • hperkins

    hperkins - 2007-07-12

    Logged In: YES
    user_id=728235
    Originator: YES

    Sorry I haven't replied sooner, but I can't let this go at "user needs to find the compiler". At least a few reasons:

    - This has happened before, several years ago, and it got fixed then. (Maybe when the compiler interface changed from 1.4 to 1.5 or something like that?) It's worth fixing again this time. Maybe it takes some hacks to look for the compiler in the "normal" places that the Java installer puts it in a standard installation. If a user who installs things in non-standard places has to do some additional configuration, that's a different issue. But DrJava ought to at least work with a default Java install.

    - It's not a problem with the current stable release (20070130-2255), which seems to work fine with current releases of Java 5 and 6. So something changed in the current beta that broke the compiler interface, which means there's reason to hope it can be restored to working as it did 6 months ago (at least from an outsider's perspective).

    - But here's the high-order bit: DrJava is supposed to be suitable for beginning students. To the extent that they have to worry about finding jar files inside the Java directories, or set classpaths, or do other arcane things to get a simple program to compile, DrJava is broken. Beginners, much less other casual users, should not have to deal with this sort of thing to get their first sample program to run when everything is new to them. It just makes intro programming seem mysterious and impenetrable to those who are not part of the priesthood.

    So it's something that should be fixed before the next stable release. Thanks.

     
  • hperkins

    hperkins - 2007-07-12
    • labels: --> Compilation problem
    • status: pending --> open
     
  • Christopher Warrington

    Logged In: YES
    user_id=666678
    Originator: NO

    We understand and are working on this issue right now. As you surmized, some of the changes that we made wrt. the compiler interface seem to be causing this problem. At the moment, we are attempting to isolate the changes that caused this reduction in functionality.

    I'll leave this ticket open so that you are notified when we have been able to fix it.

     
  • Mathias Ricken

    Mathias Ricken - 2008-01-18
    • assigned_to: nobody --> mgricken
    • status: open --> closed
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.