#259 DrJava on the Mac

Other (56)

Filed on behalf of Joseph Austin

I've recently switched from Windows to Mac. I'm using Dr. Java 20100816 on a Mac OSX 10.6 Snow Leopard.

I'm encountering some problems relating to the file structure on the Mac, which doesn't seem to have drive letters.
(the texts and examples I have are for windows systems).

1. I can't seem to use my flash drive, either for source or for data files, from inside Dr. Java;
the only disk I can see in the selector box on the open window is the "Macintosh HD"

2. Can I put data files for File IO in a directory other than the "Working" directory? How?

3. Can I create packages in Dr. Java?
When I include a package statement, I keep getting errors saying the package name does not match the directory name.

4. What is the relationship between the Dr.Java Project and the Java Package?
Specifically, how do I set the project properties to fit in with my com.domain.xx.yy.zz package directory?

5. Are there any books or documentation specifically addressing Dr Java (or just Java in general) on the Mac?

Thanks for your help,

Joseph Austin


  • Mathias Ricken

    Mathias Ricken - 2010-08-30
    • assigned_to: nobody --> mgricken
    • status: open --> pending
  • Mathias Ricken

    Mathias Ricken - 2010-08-30

    Hi Joseph,

    Thank you for using DrJava. Several of us are developing DrJava on Macs. Mac OS is a bit different, but DrJava works just as well.

    1. When you insert a flash drive, it gets mounted in the /Volumes directory. For example, my MacBook's name is "manifold". When I go to the File -> Open dialog and click on the drop-down menu at the top that lets me select from a stack of directories, "manifold" is displayed at the very bottom (above that, is often "Users", the user name, and then perhaps "Documents").

    When I select "manifold", I get to the root directory of my computer. There, I select Volumes, and that's where my flash drive shows up.

    2. Yes, you can put data files for file I/O anywhere you have read and/or write access. My desktop, for example, is at /Users/mgricken/Desktop. You can use absolute paths like that, starting with a forward slash, or use paths relative to the working directory.

    3. You can create packages. Java specifies that the directory structure must mirror the package structure. If you put a package statement like

    package foo.bar;

    at the top of a file, then that file should be saved in a foo/bar directory inside the directory that corresponds to the default package. DrJava will try to work even with files that do not do this correctly, but the results may not be perfect. It is best to follow the Java specification.

    By the way, this behavior is no different than it was on Windows.

    4. The "Project Root" of a project should be the directory that corresponds to the default package. For example, if I have the files for the package com.domain.xx.yy.zz in the /Users/mgricken/Desktop/myProject/src/com/domain/xx/yy/zz directory, then the project root should be /Users/mgricken/Desktop/myProject/ .

    5. There really aren't that many differences between Java or DrJava on the Mac and Java or DrJava elsewhere. The user interface is a bit different, paths to files are different, but largely, DrJava and Java in general are cross-platform. Any DrJava or Java text should do.

    I hope this helps. If you have further questions, please let us know.

  • SourceForge Robot

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).

  • SourceForge Robot

    • status: pending --> closed

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks