Java noob - help setting up eclipse

In summary: Java.If you have been able to compile other Java programs, I would recommend looking into getting a different Java development environment.
  • #1
Hercuflea
596
49
Hello and thank you for putting up with this noob question.

The directions on the website or anything I have found on the internet are not very descriptive.

I have downloaded Eclipse and Java JDK version 7 and successfully installed both of the applications on my computer, but I must have missed something.

My code is perfect and has zero red lines, but when I try to run it I get this error:

"Error: Could not find or load main class org.eclipse.persistence.internal.libraries.asm.util.ASMifierClassVisitor"

I am not a computer programmer but I am just using what I have learned in my first computer science class to do a physics project. Please help me get this stupid program set up so I can have my project done by the due date.
 
Technology news on Phys.org
  • #2
Hercuflea said:
Hello and thank you for putting up with this noob question.

The directions on the website or anything I have found on the internet are not very descriptive.

I have downloaded Eclipse and Java JDK version 7 and successfully installed both of the applications on my computer, but I must have missed something.

My code is perfect and has zero red lines, but when I try to run it I get this error:

"Error: Could not find or load main class org.eclipse.persistence.internal.libraries.asm.util.ASMifierClassVisitor"

I am not a computer programmer but I am just using what I have learned in my first computer science class to do a physics project. Please help me get this stupid program set up so I can have my project done by the due date.

I've never encountered that issue before. When you say that your code is "perfect", do you meanthat you can compile and run it from a shell without issue? If so, you may want to ask about your problem in Eclipse's newcomer forums (see here.

What OS are you using? What version of Eclipse? Can you post a screenshot of the error?
 
  • #3
Hello and thank you for the reply.

This code ran perfectly at my school so there is something wrong with how my computer is set up. It is a Windows 7, most recent version of eclipse (I clicked the one with the most downloads, I think EE), and Java JDK version 7.

Code:
public class PhysicsProject {
	public static void EulerMethod(double angdegree) {
		System.out.println("For angle: " + angdegree + " degrees.");
		
		double theta = Math.toRadians(angdegree);
		double vinx = (255) * Math.cos(theta);
		double viny = (255) * Math.sin(theta);
		final double deltat = .05;
		final double g = 32;
		final int increment = 208;

		double[] vx = new double[increment];
		double[] vy = new double[increment];
		double[] xpos = new double[increment];
		double[] ypos = new double[increment];

		vx[0] = vinx;
		vy[0] = viny;
		xpos[0] = 0;
		ypos[0] = 0;
		
	
		for (int i = 1; i < vx.length; i++) {
			vx[i] = vx[i - 1] + deltat * (-.25 * vx[i - 1] - .247 * vy[i - 1]);
			vy[i] = vy[i - 1] + deltat * (-.25 * vy[i - 1] + .247 * vx[i - 1] - g);

		}

		for (int i = 1; i < xpos.length; i++) {
			xpos[i] = xpos[i - 1] + deltat * vx[i - 1];
			ypos[i] = ypos[i - 1] + deltat * vy[i - 1];

		}
		System.out.println("xpos");
		for (int i = 0; i < xpos.length; i++) {
			System.out.println(xpos[i]/3);
		}
		
		System.out.println();
		System.out.println("ypos");
		for (int i = 0; i < ypos.length; i++) {
			System.out.println(ypos[i]/3);
		}
	
	}
	
	public static void main(String[] args){
		EulerMethod(4);
		System.out.println();
		EulerMethod(6);
		System.out.println();
		EulerMethod(8);
		System.out.println();
		EulerMethod(10);
		System.out.println();
		EulerMethod(12);
		System.out.println();
		EulerMethod(14);
		System.out.println();
		EulerMethod(16);
	}
}
 

Attachments

  • JavaError.jpg
    JavaError.jpg
    24.1 KB · Views: 493
  • #4
Your code compiles and runs fine here.

My guess is that when you made your new project in Eclipse, you probably selected the wrong project type. Typically, you'll want to use New Project -> Java Project, *not* any others since this may introduce dependencies that you haven't satisfied.

By the way, you're almost certainly not looking for Eclipse EE. Eclipse Classic or Eclipse for Java Developers are both more than sufficient for your needs.
 
  • #5
coalquay404 said:
By the way, you're almost certainly not looking for Eclipse EE. Eclipse Classic or Eclipse for Java Developers are both more than sufficient for your needs.

I'm guessing that "EE" stands for Enterprise Edition.
 
  • #6
I think I might just uninstall eclipse and retry again.

Is there some process that I am missing when installing?

1: Install Eclipse
2: Install Java JDK (where does it go?, and can you do this from inside eclipse?)
3: Install Java documentation (where does it go?)
4: Start programming?

edit* The project type is a Java Project. So I really have no idea what's wrong.
 
  • #7
Here is a youtube video that shows how to install Eclipse on Windows:
 
Last edited by a moderator:
  • #8
Have you been able to compile any other Java program, or is this the first one?
 
  • #9
Install the JDK FIRST and let it install at the default location. Make sure you get 64-bit or 32-bit correct if using Windows. Then, after that, try installing Eclipse. Go into Eclipse' settings afterwards and verify that it has found your version of Java. They try running Hello World first.
 

What is Java?

Java is a popular programming language that is used to create applications, websites, and other software. It is known for its flexibility, portability, and object-oriented approach.

What is a Java noob?

A Java noob, or a beginner in Java programming, is someone who is new to the language and is just starting to learn how to code in Java.

What is Eclipse?

Eclipse is an integrated development environment (IDE) that is used for Java programming. It provides a user-friendly interface for writing, testing, and debugging Java code.

How do I set up Eclipse for Java programming?

To set up Eclipse for Java programming, you will need to first download and install the Eclipse IDE for Java developers. Then, you will need to configure the Java Development Kit (JDK) in Eclipse. This will allow you to create and run Java projects in Eclipse.

How can I get help with setting up Eclipse for Java programming?

If you are having trouble setting up Eclipse for Java programming, you can consult online tutorials, forums, or seek help from experienced Java developers. You can also refer to the official Eclipse documentation for step-by-step instructions on setting up Eclipse for Java development.

Similar threads

  • Programming and Computer Science
Replies
2
Views
847
  • Programming and Computer Science
Replies
8
Views
1K
  • Programming and Computer Science
Replies
1
Views
1K
  • Programming and Computer Science
Replies
2
Views
2K
  • Programming and Computer Science
Replies
4
Views
3K
  • Programming and Computer Science
Replies
1
Views
273
  • Programming and Computer Science
Replies
10
Views
2K
  • Programming and Computer Science
Replies
11
Views
2K
  • Programming and Computer Science
Replies
4
Views
1K
  • Programming and Computer Science
Replies
3
Views
4K
Back
Top