1

I am using DrJava's plugin for Eclipse (4.3), and the interactions pane "view" is acting funny. (Very similar to this guy from 2011). Unfortunately, his question has no responses.

I also found this, however it's from 2004, and hasn't solved my problem.

DrJava refuses to acknowledge or instantiate objects, even though it throws no error.

Welcome to DrJava.  Working directory is C:\Users\Raghav
> int j = 4
> j
4
> import javax.swing.*;
> JFrame j = new JFrame();
> j
4
> 

I'm not sure why this happens, as it does not give an error on the import.

I also tried this:

Welcome to DrJava.  Working directory is C:\Users\Raghav
> import javax.swing.*;
> JFrame s = new JFrame()
> s
Static Error: Undefined name 's'

To be sure it was a problem with the plug in, and not java itself, I entered the same code into the interactions pane in drjava (20130901-r5756). It worked as expected here:

Welcome to DrJava.  Working directory is C:\Users\Raghav
> int j = 4
> j
4
> import javax.swing.*;
> JFrame j = new JFrame()
> j
javax.swing.JFrame[frame0,0,0,0x0,invalid,hidden,layout=java.awt.BorderLayout,title=,resizable,normal,defaultCloseOperation=HIDE_ON_CLOSE,rootPane=javax.swing.JRootPane[,0,0,0x0,invalid,layout=javax.swing.JRootPane$RootLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777673,maximumSize=,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true]

So I have two questions:

  1. How can I fix the plug-in not acknowledging the creation of objects?
  2. Is there anyway to change the working directory in the plugin? I've only found this possible in Dr.Java IF a new Project is created, or under Preferences -> Resources -> Extra ClassPath. This is because I have different projects in different folders, and I'd like to test the classes, but I can't change my classpath to their location.

This is my first post on SO, please let me know if this questions needs any edits, or is not clear enough.

Thanks.

4

0 回答 0