• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

Difficulties with Dr Java

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:Since the days when the original post in this thread was written, the separate JRE has been withdrawn.


Hi! I'm still actually having this issue. Do the steps above still apply or do I need to do something else? thanks My class requires this program and it's very difficult to code and not be able to run
 
Marshal
Posts: 72407
315
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch

Please explain whether you are having difficulty with Dr Java or with writing your code. Please give us more details of the proble you are facing.I prefer to use the command line/terminal for simple code, and I am not familiar with Dr Java.
I am going to create a new thread for you because you have asked a new question.
 
Grace Garrett
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So I'm actually having the same issue with the "Current document is out of sync with the Interactions Pane and should be recompiled!" I was looking at the previous post because it addressed the same problem but I'm still confused with it. The code itself works because I send it to my friend and he can run it. It's not only this specific code, it's everything I run. I'm not quite sure how to post a picture of it.
Also I'm glad I found the Ranch because I think it will be super helpful
 
Campbell Ritchie
Marshal
Posts: 72407
315
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is where I split the present question from.

Have you installed Java® correctly? Do you know how to compile and run code from the command line/terminal? Have you got anything to run at all? Where are you saving your XYZ.java files? Do you  know about the simplified way to run small Java® applications from the command line, which was introduced after the older thread was completed?
 
Grace Garrett
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Java is installed correctly because I've had it on my PC for a long time and it works with other things requiring Java.
I believe I know how to run compile it from the terminal, I'm not sure what that means exactly but I just press the compile and run buttons at the top.
I haven't been able to get anything to run on my DrJava but I have on my friend's.
All my files are being saved in a folder I made for my class.
I'm not sure what the simplified way to run small java applications is, so that could be the issue.

Hopefully this answers your questions
 
Campbell Ritchie
Marshal
Posts: 72407
315
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Grace Garrett wrote:. . .
I believe I know how to run compile it from the terminal, I'm not sure what that means exactly but I just press the compile and run buttons at the top.
. . .
I'm not sure what the simplified way to run small java applications is, so that could be the issue.

Hopefully this answers your questions

Yes, it does, well most of them, but you need to answer your question.
No, that isn't using the command line or terminal. On Unix‑like OSs, you use the terminal every hour, so you would be familiar with it, so I shall assume you are running Windows®. It is such a long time since I opened a Windows® command line (they don't call it a terminal) that I have forgotten how to do it. Try All Programs→Accessories→System tools→Command prompt. I think it is called command prompt rather than command line.
Use the following two commands and make sure you get sensible results from both.You can use double‑dash: ‑‑version instead of ‑version, I think for both.
If the version number is higher for javac than java, you will have problems and will have to edit your system PATH or install something else.

Use the cd instruction followed by the name of the location of your XXX.java files from where your command window opened; I think it defaults to your named directory in Users. The abbreviation cd means change directlry.
 
Campbell Ritchie
Marshal
Posts: 72407
315
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry, I pushed submit instead of preview by mistake, so you only got half an answer.

Once you get to that directory, use single file execution (Java11+ only, I think). Edit and save an XXX.java file with any number of classes in, but the first class written has to have the main() method. At this point, a “Hello, World!” would do nicely. Execute it with java XXX.java. If you get error messages with Java® compiler errors in, assume it is working and will execute correctly whenever you correct those errors. If you get a “Hello, World!” to execute correctly, you have proved you can write and load and compile code, and that the installation is working properly. Even without Dr. Java.
Confirming a correct installation is the only use for a “Hello, World!”; it isn't an example of great programming style!
 
Grace Garrett
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sounds good! I am about to head to work but when I get back, I will try that out and let you know. Also, I am using Windows lol. Thank you
 
An elephant? An actual elephant. Into the apartment. How is the floor still here. Hold this tiny ad:
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic