| | |
how to javac mycode.java and swing-layout-1.0.jar
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
you need to setup CLASSPATH to your JAR file and then you will be able to compile your code simple way
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
As I said previously you need to set CLASSPATH to location of JAR file. By doing so you tell your machine where the JAR can be found. So what you do is as follow:
Start > Control Panel > System
here select tab Advanced > Environment Variables
In system variables check if you have CLASSPATH, if not press New
In Variable name : type in capitals CLASSPATH and in Variable value : insert full path yo your JAR file which can be for example like this C:\Development\Custom_lib\swing-layout-1.0.jar;
I would recomend you restart your machine as this changes do not always take place after editing so it is better to restart system. Once this done you can compile your code as simple as this
Start > Control Panel > System
here select tab Advanced > Environment Variables
In system variables check if you have CLASSPATH, if not press New
In Variable name : type in capitals CLASSPATH and in Variable value : insert full path yo your JAR file which can be for example like this C:\Development\Custom_lib\swing-layout-1.0.jar;
I would recomend you restart your machine as this changes do not always take place after editing so it is better to restart system. Once this done you can compile your code as simple as this
javac mycode.java Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
You can also set the classpath as a parameter when you execute javac:
Java Syntax (Toggle Plain Text)
javac -cp "c:/program..swing-layout-1.0.jar" myCode.java
![]() |
Similar Threads
- Exception in thread "main" java.lang.NoClassDefFoundError: Invaders Error (Java)
- Problem with java (Java)
- New to Java, can't get program to compile (Java)
- Java awt and swing event handling (Java)
Other Threads in the Java Forum
- Previous Thread: Java rmi-ps help
- Next Thread: best tutorial
Views: 2265 | Replies: 4
| Thread Tools | Search this Thread |
Tag cloud for Java
6 android api apple applet application arguments array arrays automation binary bluetooth bold byte c++ chat class classes client code component coordinates database datagram doctype draw eclipse educational error event exception file fractal froglogic game givemetehcodez graphics gui helpwithhomework html ide ideas image ingres input integer internet intersect ip j2me java javaexcel javaprojects jmf jni jpanel jtextarea julia linux list loop map method methods mobile netbeans newbie nextline number object oracle pong print problem program programming project recursion recursive scanner screen sell server set size sms socket sort sql string swing test threads time transfer tree user web websites windows






