/help
"Caused by: java.lang.ClassNotFoundException: Date"
I went to the project properties-?Java build path -> Libraries -> Add external class folder
Then I went to "Order and export" and I activated everything and it is still doesn't work.. why?
46 Replies
⌛
This post has been reserved for your question.
Hey @Yarden! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
Do you have other classes in the same package?
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
Eclipse
Nope only this right now
Didn't do much
Just created the class, added the external class "Date" and activated javaSE-1.8
Can you show the project in the package explorer?
How did you add it?
and can you show that external class?
And why did you add it?
Did you add it to the build path somehow?
I added an external class that I got from the university as homework.
I need to create a main class which uses it's functions\methods
ok so the difficulty is that you can't really access anything in the default package
What is shown when double-clicking the
Date.class
?there is more
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
Never did it
How do I do this?
import java.util.Date?
Do you have access to the source code of that clas?
Nope
Only the class
We will implement the class code in the next homework
then you can't really change the package of that class
Did your teachers tell you how to do that thing with referenced libraries?
They recommended to work with blueJ, but I hate this workspace
Prefer eclipse
With blueJ everything is simpler with classes
But I just prefer to know how to do so also with eclipse
ok I don't know whether that's possible, it's definitely not something that should be done and I guess BlueJ does something a bit weird
You could try copying the class file to the bin directory
open the project in your file explorer (outside of Eclipse)
Is there a bin directory?
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
Tried to copy to bin
Didn't work
@borgrel @dan1st | Daniel
I think i'll just work with blueJ
Can you show that?
you should be able to switch back as soon as you don't have any such class files in the default package
or maybe you could try to copy the class file to the src directory
I restarted eclipse and I got a big error about this class inside the bin, and now it shows errors in the main
Can you show the errors?
Like it doesn't even exist
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
Do you still have the external class file folder thing?
Do you mean this?
I'll ask to replace him hahaha
the libraries tab
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
Yeah they are asking us to use an old version of java so we can practice the "harder way"
it is if you use BlueJ
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
I am not so sure about that
most IDEs allow using the default package
at least Eclipse, IntelliJ and VSC do
Can you expand the date class thing there?
And also copy the
Date.class
file to both the src and bin folder?Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
yeah I might have time to check this more later
Thank you anyway for helping, I appreciating this!
I moved to blueJ for now
If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
💤
Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping
.
Warning: abusing this will result in moderative actions taken against you.
@Yarden ok so I tested it and for me, it works in Eclipse
So you need to create one folder containing the
Date.class
somewhere
you don't need to put it in src or binin the Libraries tab of the build path, select
Add external Class Folder
and select the folder with the Date.class fileand then I was able to use it
even if both are in the default package
maybe make sure you are using the latest Eclipse version or try with a newer Java version (but make sure you are using the classpath and not the modulepath for the external class folder)
💤
Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping
.
Warning: abusing this will result in moderative actions taken against you.