• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Has anyone been able to run Oracle's Beeper.java script?

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Name: Sherman
Platform: HP Compaq 6710b
Operating System: Ubuntu 17.10
postgresql version: 9.6
openjdk version: 1.8
javac version: 1.8

I have been able to implement several learning scripts so far but this one is giving me trouble. When I installed jdk 8 the installation script said that it should not be installed as root so I installed it to /home/sherman/build_environmnet/jdk1.8.0_161. I put netbeans in /home/sherman/build_tools/netbeans-82.

Since I couldn't find the main class just by running java Beeper I found that I needed the rt.jar file. So I ran the script again with java -cp "/home/sherman/build_environment/jdk1.8.0_161/jre/lib/rt.jar" Beeper. It ust returned the same error message of "Error: Could not find or load main class events.Beeper".  The script is shown below.


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

java -cp "/home/sherman/build_environment/jdk1.8.0_161/jre/lib/rt.jar" Beeper
It ust returned the same error message of "Error: Could not find or load main class events.Beeper".  


The error message and the commandline used don't match.  The commandline does not use the package name (possibly the problem)
and the error message does have the package name.

On Win10 I get this when I execute the java.exe command in the same folder as the Beeper.class file:


java.exe -client Beeper

Error: Could not find or load main class Beeper
Caused by: java.lang.NoClassDefFoundError: events/Beeper (wrong name: Beeper)

 
This. Exactly this. This is what my therapist has been talking about. And now with a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic