944,082 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 2982
  • Java RSS
Jun 18th, 2007
0

how to javac mycode.java and swing-layout-1.0.jar

Expand Post »
I have a code generated with netBeans. It use org.jdesktop.layout. I have the file swing-layout-1.0.jar. But I don't know how to compile and run mycode.jave with that jar file.
Please write full comands if possible. I'm so new to java that every step use me 2 hours - 2 days. Thanks a lot.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
dajiebuda is offline Offline
8 posts
since Jun 2007
Jun 18th, 2007
0

Re: how to javac mycode.java and swing-layout-1.0.jar

you need to setup CLASSPATH to your JAR file and then you will be able to compile your code simple way
Moderator
Featured Poster
Reputation Points: 2786
Solved Threads: 874
Code tags enforcer
peter_budo is offline Offline
6,659 posts
since Dec 2004
Jun 18th, 2007
0

Re: how to javac mycode.java and swing-layout-1.0.jar

my code is in fold Myfold. the jar file is in another fold c:\programs...

I run javac in c:\myfold.

I need to complie both mycode and the jar code together. Please tell me what I can do.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
dajiebuda is offline Offline
8 posts
since Jun 2007
Jun 18th, 2007
0

Re: how to javac mycode.java and swing-layout-1.0.jar

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 javac mycode.java
Moderator
Featured Poster
Reputation Points: 2786
Solved Threads: 874
Code tags enforcer
peter_budo is offline Offline
6,659 posts
since Dec 2004
Jun 18th, 2007
0

Re: how to javac mycode.java and swing-layout-1.0.jar

You can also set the classpath as a parameter when you execute javac:
Java Syntax (Toggle Plain Text)
  1. javac -cp "c:/program..swing-layout-1.0.jar" myCode.java
Moderator
Featured Poster
Reputation Points: 3239
Solved Threads: 839
Posting Genius
Ezzaral is offline Offline
6,761 posts
since May 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: Java rmi-ps help
Next Thread in Java Forum Timeline: best tutorial





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC