| |

VerySource

 Forgot password?
 Register
Search
View: 768|Reply: 2

A simple question, after doing a lot of debugging, it just won't work, wondering ~! !!

[Copy link]

1

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-1-6 19:20:01
| Show all posts |Read mode
I use Jcreator
import javabook. *;
class rr
{
public static void main (String args [])
{
MainWindow mainwindow;
mainwindow = new MainWindow ();
mainwindow.setVisible (true);
     }
}
Then save it as rr.java.
Run F5 directly, prompt: Exception in thread "main" java.lang.noclassdeffounderror: rr

Also asked, some people say that the classpath is set incorrectly. My settings are:
.;% java_home%\lib;% java_home%\lib\tools.jar;

And if compiled before running, there will be: package javabook does not exist
                                  No symbols found

May I ask how is this going?
It wo n’t work for a long time, expert advice!
Reply

Use magic Report

0

Threads

2

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-1-7 08:39:01
| Show all posts
1 . You first confirm that the javabook package does not exist
2. After setting the CLASSPATH, add the path of the javabook (the directory name above the javabook, such as:
c:\workspace\javabook\, then it should be:
.;% java_home%\lib;% java_home%\lib\tools.jar; c:\workspace;

I am very new, please advise.
Reply

Use magic Report

1

Threads

6

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

Post time: 2020-1-7 23:36:01
| Show all posts
You look at the path of the compiled .class file, append that path to the environment variable, or run the file directly under that path, try it.
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list