IntelliJ unable to run the class/compiled class
My problem is not being able to run the core.DTNSim because intelliJ said that some methods are undefined. Weirdly, I already set the project source to
src
directory, then setting the run config's output directory to the same one i compiled the project (target
). The run does not want to run. I'm not sure what other informations I can provide, but it is all in the picture.
29 Replies
⌛
This post has been reserved for your question.
Hey @circle! 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 marked as dormant after 300 minutes of inactivity.
As seen from the error, it couldn't find the class DTNSimGUI even though it is within the project and is compiled properly.
It's ONE simulator project btw
💤
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.
Can you show that class in the src folder?
as well as the content of the file as text
it's pretty hard to read stuff in your screenshot
I usually use this batch file to run the program instead of utilizing IntelliJ (it's an old framework), so it works normal without the running config
This is the whole structure and the run configuration


Does the error occur with the run configuration or with the batch script?
run configuration!
I'm so not used on using the built in run configurations for these pure java stuffs... no maven/gradle sadly
Are you using a build tool (Maven/Gradle)?
ah ok
Not on this project, it's an older framework
When running the project, it has a line like
java --enable-preview ...
at the top
cna you copy that line?A friend's version of the program does work, but it's much more outdated and simplified- This one is pretty modifeid but I haven't had the time to compare (a lot of differences)
oh yeah here
OH
wait
i think i saw it?
after
target\
, it points to production
?it does seem to expect the compiled classes in
D:\Development\Java\jarkom22-onesim-archive\target\production\jarkom22-onesim-archive
How did you create the run configuration?this
and the project structure outpuot here
That's showing the run configuration but now how you created it
I did it by:
1. Opening run configurations
2. Clicking + sign to add
3. Choosing "Application"


i think it's all it is. Havent tried to use the Batch option (for step 3)
What is shown in "Modify options"?

II... I might've just solved it?
by creating a new run configuration?
What I just did was checking the "Modify Classpath", then added the target folder (literally the
target
) folder
and it just runs :idontunderstand: d

ok
Aight, seems to be solved now. Thank you so much! I overlooked the part where you told me this
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 Closed
This post has been closed by <@389034898666553344>.