#jar
1 messages · Page 1 of 1 (latest)
<@&987246399047479336> please have a look, thanks.
are you doing it manually?
but i can't run
isnt better to use a build system?
?
something like Gradle, Maven
i try with jar but i can't start jar
i using vs code i can't use
run code :
java -cp "json-simple-1.1.1.jar" LoginFrame
error :
error: Class names, 'LoginFrame', are only accepted if annotation processing is explicitly requested
1 error
i don't understand this error
so you want to run a jar file
use java -jar
eg
java -jar json-simple-1.1.1.jar
now if there is an error saying there is no main class
java -jar -cp "json-simple-1.1.1.jar" LoginFrame
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: Unable to access jarfile LoginFrame
Detected code, here are some useful tools:
Request failed: Too Many Requests. Too many sessions, try again later :(.
it's
java -jar "json-simple-1.1.1.jar"
Error: Unable to access jarfile json-simple-1.1.1.jar
you don't have a jar then
create a jar first
before you use java
or do
java your.main.Class
ok
this and i cant use jar
"add"?
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
at main.java.LoginFrame.main(LoginFrame.java:115)```
probably refers to add to classpath
line 155 :
public static void main(String[] args) throws Exception {
Please just use maven or gradle
yeah that what I was saying
@sturdy vigil it will make your life easier when programming in java
I uploaded your attachments as Gist.
netbeans pom.xml
set a main class
Okayso in that command you need your code too
json-simple-1.1.1.jar is just part of your code
java -cp "json-simple-1.1.1.jar;your-code.jar" LoginFrame
or, if you are using java 22+
java -cp "json-simple-1.1.1.jar" src/LoginFrame.java
replace src/LoginFrame.java with wherever your code is