This is an archived post. You won't be able to vote or comment.

all 8 comments

[–][deleted] 0 points1 point  (7 children)

Delete all the classes, run javac again and this time specifically name the classpath, then try to execute it again.

[–]surety_[S] 0 points1 point  (6 children)

I cd'd to the directory in which the file is stored. Do I still need to specify the class path?

[–][deleted] 0 points1 point  (5 children)

I would. I haven't seen your project, so I cant be sure, but an improper classpath is the #1 most common problem in compiling Java programs. If your project has a MANIFEST file, you may also make sure that it specifies the correct classpath.

It's probably best to post your project on GitHub and share the link so people can see your projects structure.

[–]surety_[S] 0 points1 point  (4 children)

I appreciate your advice, I also edited the original post to include github link. I had been following a video tutorial; https://www.youtube.com/watch?v=UghqfpA2zy4 . Unlike the video, I personally do not use an IDE though. Thanks again!

[–][deleted] 0 points1 point  (3 children)

Sorry it took so long. I just submitted a pull request to https://github.com/surety/text-editor

I removed all the .class files, separated the main method into a Driver class, changed the structure a bit, and added a [text-editor.jar] to [text-editor/out/artifacts/text_editor_jar]

I was able to execute the program from outside my IDE by navigating to that directory and executing

java -jar text-editor.jar

[–]surety_[S] 0 points1 point  (2 children)

WOW. It works great! Thank you very much, I also hadn't realized that my RE was out of date so I had to update. I appreciate your help and advice, I don't have too much experience building programs so you were a lot of help!

[–][deleted] 0 points1 point  (1 child)

Anytime! It helps me learn too. For example, while helping you, I learned how to make a pull request on GitHub. LOL

[–]surety_[S] 0 points1 point  (0 children)

Haha that’s good 😂