Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Default package's Cadence.java is now inoperable(All smoke and no fire, sorry. Probably it was due to my old nemesis, Operator Error.)
Default package's Cadence.java is now inoperable [message #1797242] Mon, 29 October 2018 05:56 Go to next message
Patrick Moran is currently offline Patrick MoranFriend
Messages: 141
Registered: March 2018
Senior Member
This question is based on a mistake. Cadence.java is a file that I had copied to experiment with. How it got referred to when I was working on another project, I don't know.
import javax.swing.*;
import java.awt.*;
import java.awt.*;
import java.applet.Applet;
import java.applet.AudioClip;
import java.net.URL;


public class Cadence extends JFrame {

		URL url = [u]AddSound[/u].class.getResourceAsStream([u]soundTest[/u].wav);
		[u]AudioClip[/u] clip = [u]Applet.newAudioClip[/u](url);
	
	public void AddSound() {
		[u]super("AddingSound");[/u]
		[u]setLayout (now[/u] FlowLayout());
		
		[u]Play[/u].addActionListenerI( new [u]ActionListener[/u]){
			public void
			
				[u]clip.play[/u];
		}
	});	
	[u]Loop[/u].addActionListener(new [u]ActionListener[/u]() {
		public void actionPerformed([u]ActopmEvemt evemt[/u]{]
				[u]clip.play[/u]();
		}
	
	
  });// end of AddSound
		
    [u]Stop.addActionListene[/u]r({
    	public void actionPerfoirmed([u]ActionEvent[/u] event) {
    		
    		
    	}
   });
    add([u]Play[/u]);
    add([u]Loop[/u]);
    add([u]Stop[/u]);
}

None of the colors or strike-throughs came through so I'll try to add a screen shot. I tried to fix this file but couldn't handle so many interacting problems.

Somebody must be in charge of writing and of the upkeep of this piece of code. It needs to be rewritten.

[Updated on: Sun, 11 November 2018 16:15]

Report message to a moderator

Re: Default package's Cadence.java is now inoperable [message #1797333 is a reply to message #1797242] Tue, 30 October 2018 04:51 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4430
Registered: July 2009
Senior Member

If you hover over the underlined text, it should show you a message about why it's underlined. You can also check the Markers or Problems Views.

_
Nitin Dahyabhai
Eclipse Web Tools Platform
Re: Default package's Cadence.java is now inoperable [message #1797450 is a reply to message #1797333] Wed, 31 October 2018 06:48 Go to previous messageGo to next message
Patrick Moran is currently offline Patrick MoranFriend
Messages: 141
Registered: March 2018
Senior Member
Thank you for your reply, but please note that Cadence is a class located in the default package.
If I had the ability to program Java's own Java code at a developer's level, I might be able to fix this code for Java.

I had simply copied over a program I wrote and had been using for some time on Oxygen, where there was no problem, to a new computer and the new Photon. All of a sudden the thing would not work. There was no sign of any errors showing on my own code. By chance I learned how to go deeper down and find the problem in Cadence. Cadence is either something that Java wrote or possibly something the Eclipse wrote. Even if I managed to fix all of the dependencies that are now creating problem in the Cadence code, it would not do other Eclipse users any good, nor would it do other Java users any good.

I am on my old computer now, getting ready to decommission it, so I can't see what any hovering showed me the last time, but as you can see by the crossed out items (java.applet.Applet, and java.applet.AudioClip, ) it would appear that they are deprecated, and I would guess that they have gone beyond that point and have been removed entirely from the latest Java. As for the rest of default package/Cadence, about half of the lines have red underlining. None of this is, and none of it depends on, code that I have written.

I can just find another way to play MP3 files in my program, but somebody else will sooner or later find that their code is mysteriously failing and they may not luck out and discover that the problem is something in the default package.

Actually, as somebody else wrote in a critique of Eclipse elsewhere, it is better not to advance forward through new versions of Eclipse if the old version is working o.k. for you. Probably I will just delete Photon from my new computer and hope that putting Oxygen in its place will eliminate some of these problems.

Thanks again for your help.
Re: Default package's Cadence.java is now inoperable [message #1797465 is a reply to message #1797450] Wed, 31 October 2018 09:40 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
This looks more like a problem with the version of Java that you're using. As of Java 9 with the introduction of modules, it's often gotten much more complicated to ensure that things are on the classpath/module path. With subsequent versions of Java, things are getting any easier in that regard, e.g., any javax.* classes are now harder to access. Also, package-less classes are not well tolerated in newer versions of Java. Best to avoid them.

This is all to say that in all likelihood your problems mostly arise from having a newer version of Java on your newer machine.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Default package's Cadence.java is now inoperable [message #1797483 is a reply to message #1797465] Wed, 31 October 2018 14:06 Go to previous messageGo to next message
Patrick Moran is currently offline Patrick MoranFriend
Messages: 141
Registered: March 2018
Senior Member
I haven't been able to find any Java documentation for Cadence.java. If it is an Eclipse group written class, then shouldn't somebody minding this part of your code be informed that users will find things mysteriously failing?

I just googled for "Cadence.java" and found nothing but stuff about Oracle's release cadence, which is just a policy matter entirely related to what I am writing about.

If Eclipse developers are content to leave broken software when a new Java release comes out, then what does that say about the maintainability of old software that one has produced. Apple's ability to preserve the utility of older software is quite refreshing. There haven't been any major convulsions since the change to OS 4. I thought one of the objects of Java was to be able to write software that would work on many different systems. If it works on both Windows and Macs, but only for a couple of years, then maybe I'm foolish to try to use Java.
Re: Default package's Cadence.java is now inoperable [message #1797494 is a reply to message #1797483] Wed, 31 October 2018 16:35 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
I'm just a helpful guy that answers questions here. I don't know Cadence.java come from. I assumed you wrote it. Is that not the case?

And as I've tried to explain, the same software that compiles fine for Java 8 might well not compile fine with Java 9 or higher because there are now things such as javax packages that are no longer by default on the classpath. The file you show mostly compiles in my latest installation of Eclipse, but with a Java 8 JRE configured. In the end, no one here can control how Oracle is changing Java and what breaks as a result of that.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Default package's Cadence.java is now inoperable [message #1797518 is a reply to message #1797494] Thu, 01 November 2018 05:54 Go to previous message
Patrick Moran is currently offline Patrick MoranFriend
Messages: 141
Registered: March 2018
Senior Member
I'm sorry. I really thought the problem was in some kind of a sub-structure provided by Eclipse. Trying to write about it from my old computer, because I was involved in preparing to scrub that hard drive and reinstall everything, didn't help my memory. I had to get both computers going to see what was going on with the new computer and write about it with the old computer.

I had forgotten how Eclipse will sometimes bring in stuff from one project to the operation of another project. I just an hour or so ago had one really messed up old project that, when you tried to run it, would instead run the previous project. I quit Eclipse, rebooted, and it still did that odd thing.

I think what happened was that I was trying to verify a normally well-working project, found a problem, and then somehow my searches brought me to a Java program that was right after the one I was really working on, i.e., to one that had Cadence.java as its only class. It was a program I had copied from the Internet and never could get working, I guess. But I had no memory of the program by name or by contents when its contents showed up while I was trying to discover why the one I was trying to verify was not getting data from a DB. It wasn't open in the package explorer, so the only open-to-inspection stuff was just part of the project I was starting to work on, and I guessed that if it wasn't in a visible java program it had to be in the enclosing sub-directory. Obviously, now that I've done some more snooping, it wasn't anywhere in that subdirectory at all.

I used to be more careful about frequently starting new work spaces to avoid this kind of cross-contamination, but I hadn't had any problems for a long time and had gotten sloppy about breaking things up so that they could not interfere. (I don't see why Eclipse wasn't designed to avoid this unannounced kind of drawing on material from one project to use in another project.)

Again, I am sorry for the confusion.
Previous Topic:Running Stem
Next Topic:SWT download
Goto Forum:
  


Current Time: Thu Mar 28 12:20:20 GMT 2024

Powered by FUDForum. Page generated in 0.05509 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top