English 中文(简体)
• 如何从名录中汇编一个java方案?
原标题:How to compile a java program from directory?

I m学习java,我想知道如何从其他名录汇编一个java方案。

例如,我的汇编者正在我的驱动下c:,我希望从e:编辑我的java方案。

How should I do that? I m getting this error, what does it mean? alt text

问题回答

目前的名录应处于违约状态,但可能不是。 Try java -cp .sign

这是自我结束伊拉瓦以来的一段时期,但似乎像汇编你的问题一样。 由于<代码>javac 收益适当,似乎与<编码>Assignment.java有关。 页: 1

Well the easy way is to set ur classpath variable. Since from screen shot it seems ur using windows i suggest u right click the my computer nd select properties. Go to advance setting and click environment variable tab.

Then a new window pops up which has System Variable at bottom. Select new and create a variable JAVA_HOME = path where u installed java eg for me its c:java

Now once u add this search an existing variable path and choose edit. Now at the end append the following ;%JAVA_HOME%in Now ur done u cn run java program frm any location on ya comp....

You are using package in your code...so it shows NoClassDefFoundError when you run you should create folder which contain your package name...compile that java file...and you can run that file from previous directory of that java file directory...

例如,你的法典

package test;
class Assignment{
public static void main(String args[]){
System.out.println("Hai");
}
}

在“E:java est <>/code>上节省下来

编辑这一档案,你可以按照“E:java”的方式管理这一档案。

指挥这一档案

java test.Assignment

E:java> java test.Assignment

您的任职地点有<条码>。 java? 如果是的话,将其拆除,并重新组合起来,以便迅速解决问题。

为了与 Java一揽子计划合作,你需要一个与一揽子申报相匹配的目录结构。

例如,这就是你的任务。 java:

package myjava;

public class Assignment {
    public static void main(String[] args) {
    ....
    ....
}

您担任这一领导职务,负责汇编:

E:java>javac -d . Assignment.java

你们也得到了我的j。 如果所有班级都好了。 <代码>-d > 备选办法是指“现有目录中生成的类别档案”。 javac将一揽子等级定为您的名录。

既然贵国的名录与你的包件相匹配,这应当做到:

E:java>java myjava.Assignment




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签