Skip to main content



      Home
Home » Newcomers » Newcomers » Having problem with Classpath, lead to more problem
Having problem with Classpath, lead to more problem [message #1830483] Mon, 27 July 2020 13:39 Go to next message
Eclipse UserFriend
It seems like the classpath is missing, trying to figure out how to solve this problem. I would appreciate if someone can help me. The initial problem I was having with something else, "Could not find or load main class" when I did something in the build path.



[Updated on: Mon, 27 July 2020 16:16] by Moderator

Re: Having problem with Classpath, lead to more problem [message #1830495 is a reply to message #1830483] Mon, 27 July 2020 15:40 Go to previous messageGo to next message
Eclipse UserFriend
index.php/fa/38667/0/

I have solved the issue. However, the problem now here is, I am trying to add my existing java files into a new package. I do not know how to import java files into new package. When I try to run it say

Exception in thread "main" java.lang.Error: Unresolved compilation problem:

at ss/ss.Add.main(Add.java:6)

What I tried to do was, copy my java files from the other package and paste into the new package in bin folder

[Updated on: Mon, 27 July 2020 16:13] by Moderator

Re: Having problem with Classpath, lead to more problem [message #1830511 is a reply to message #1830495] Tue, 28 July 2020 01:59 Go to previous messageGo to next message
Eclipse UserFriend
The package structure declared in your *.java files must mirror exactly the folder structure in the file system. Above you have the *.java file in the root "src" folder, but it declares a package name so must be in src/com/<...>. Note that it's bad style to name packages with upper case names.
Re: Having problem with Classpath, lead to more problem [message #1830530 is a reply to message #1830511] Tue, 28 July 2020 10:21 Go to previous messageGo to next message
Eclipse UserFriend
The structure wasn't like this, I made an mistake, I believe what I had done was change the build or refactor. How would I go about this?
Re: Having problem with Classpath, lead to more problem [message #1830552 is a reply to message #1830530] Wed, 29 July 2020 01:12 Go to previous message
Eclipse UserFriend
I'm really not sure how you got into this state. Certainly on the first page of the Java project wizard I would choose "Create separate folders for sources and class files". It's probably better to start from scratch. On the src folder, the context menu will have things like New -> Class and New -> Package which will create the correct structure.
Previous Topic:Open file in Eclipse view programmatically
Next Topic:XML Perspective Target ID
Goto Forum:
  


Current Time: Sat Jul 05 07:03:37 EDT 2025

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

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

Back to the top