Questions tagged [drjava]

A lightweight IDE for java, designed primarily for students

DrJava is a lightweight development environment for writing Java programs.

It is designed primarily for students, providing an intuitive interface and the ability to interactively evaluate Java code. It also includes powerful features for more advanced users. DrJava is available for free under the BSD License, and it is under active development by the JavaPLT group at Rice University.

For more information and downloads, visit the official site.

188 questions
-1
votes
1 answer

Something can't be resolved?

Trying to test my java "skills" and make a text based game--except i can't get the user input. i already importd the scanner class, and it works well w/ integers so idk what the problem is quite frankly. whenever i try to compile it, the lines…
xPink
  • 27
  • 6
-1
votes
3 answers

Inserting data into unknown length array java

I am making a program for a receipt maker and the array length is unknown due to multiple items. This is the code I have: public static void main (String str[]) throws IOException { Scanner scan = new Scanner (System.in); //Entering Input …
user4998461
-1
votes
1 answer

Program won't run after I input in drJava

I'm fairly new to programming and am having trouble with a program I came up with. It's a guessing game, the user has to guess a random number generated and you have 6 chances. Unfortunately I don't quite understand what is wrong with the program.…
Udaman
  • 11
  • 1
-1
votes
2 answers

JUnit Test failing and not sure why

I'm pretty new to writing code and I am not the best, but I don't understand why my code isn't passing one of the JUnit tests I have set up. public class PA3Test { public static void main(String[] args) { } public static int countMajority(int…
-1
votes
1 answer

What is causing my NullPointerException

My program compiles perfectly, but whenever I try to run it throws a NullPointerException. I tried searching this up, and found that the error relates to some value being null while the program is trying to use it, but I re-checked everything and…
muko06
  • 1
  • 1
-1
votes
1 answer

ArrayList, private instance variable and constructor

I'm having trouble with creating an Arraylist in a new class (I'm using the DrJava IDE). The assignment is to create a constructor with n lottery tickets numbered from 1 to n. import java.util.ArrayList; public class Tombola { private…
Demeter
  • 13
  • 3
-1
votes
1 answer

Quadratic formula is wrong and I don't know how to fix

Errors: File: F:\lab_2.java [line: 36] Error: next cannot be resolved or is not a field File: F:\lab_2.java [line: 38] Error: next cannot be resolved or is not a field File: F:\lab_2.java [line: 40] Error: next cannot be resolved or is not a…
Jabari Little
  • 1
  • 1
  • 1
  • 1
-1
votes
3 answers

How to make Questions not repeat itself

So i am making a Who Wants to be an millionaire game code and i have everything working perfectly. But sometimes questions will repeat themselves, and it does not make for a good game if you ended up getting the same Question twice. I would…
-1
votes
4 answers

How to print out a field of returned value in Java

I want it to return new Dillo and print out the length of new Dillo. When I compile the code, it will say: Error: Unreachable code for the line System.out.println(this.length); How can I fix this? Thank you import tester.* ; class Dillo { int…
Bighuyou
  • 83
  • 2
  • 10
-1
votes
2 answers

Multiple classes in Java

So I have a project where I need to randomnly generate numbers to a specified number in Java. I have that part working and it takes user input, writes to a file and reads it. But here is my problem. The last portion of the assignment specifies that…
-1
votes
2 answers

Sorting Arrays, duplicate local variable, error

I am working on this code all day, and I just can't seem to get it right :( import java.util.Random; import java.util.Scanner; import java.io.*; public class TrialSixthree{ public static void main(String[]args){ Scanner i =…
-1
votes
2 answers

Why am I receiving a NullPointerException during compilation?

Hello I am currently working on a assignment for an exam in my Java programming course. Right now I am trying to make this program run without errors. Can anyone please help me to understand what I am doing wrong? I have this code and I get stuck…
Kevin
  • 17
  • 1
-1
votes
1 answer

'in' is never closed

there is a error in my code it is giving me a warning Warning: Resource leak: 'in' is never closed I have never had this problem before, in fact I tried old programs that I have written and it is still giving me the same issue. How do I fix this…
user3251123
  • 67
  • 1
  • 9
-1
votes
2 answers

package org.pdfbox.cos does not exist

I am trying to import and use PDFBox, but am having issues installing the jars I believe. I am using Dr. Java, and I have added both the pdfbox-1.8.6.jar and the pdfbox-app-1.8.6.jar to my resource locations in my Extra Classpath. However, it still…
Ctech45
  • 496
  • 9
  • 17
-1
votes
3 answers

Error in "Hello World" when compiling on Dr. Java?

I am learning Java, and am testing a simple 'Hello World' program given to me by my teacher. I am using Dr. Java on 64-bit Ubuntu 12.04 LTS. Code is below: public class Hello_World { public void go() { System.out.println("Hello,…
Qu0rk
  • 371
  • 1
  • 3
  • 9